Support » Fixing WordPress » Keep some log files updating plugin

  • Resolved termel

    (@munger41)


    Hi there,

    Our plugin uses log4php which allow allow us to log quite easily in a specific plugin subfolder : my-plugin/logs/nameofmylogfile-dd-mm-yyyy.log

    Each day a new log file is created.

    The problem is that when updating plugin, the logs directory is replaced with a new empty one, and we lose all previous log files, which can be very usefull.

    How can we manage this ? Should we log in another wp directory ? Which one ?

    Thanks a lot!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You should move your log directory to a subdirectory of /wp-content/uploads. This will allow your plugin to be updated without deleting your log directory, and the directory should always be writable.

    You should probably name the directory something plugin-specific since it’s possible a “logs” directory was created by another plugin.

    Yes, that’s right!
    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Keep some log files updating plugin’ is closed to new replies.