Giter VIP home page Giter VIP logo

Comments (9)

Shrimpstronaut avatar Shrimpstronaut commented on July 20, 2024 1

Hey @brocheafoin
I have started working on a different approach.
Currently there is no way to produce any log output if there is no domain connection.

The new approach is the following:

  • check for WP_DEBUG variable inside wp-config.php
  • if WP_DEBUG is enabled log into the default WordPress debug.log

By doing so we can assure a debug output, even if you have not set any logging settings inside the NADI plugin.

from active-directory-integration2.

Tobi823 avatar Tobi823 commented on July 20, 2024

Hi jpurpleman,

you can either change the file owner by:
Ubuntu:
sudo chown www-data /var/www/html/site.com/wp-content/plugins/next-active-directory-integration/logs/debug.log
Fedora:
sudo chown apache /var/www/html/site.com/wp-content/plugins/next-active-directory-integration/logs/debug.log

or change the file permissions:
sudo chmod +rw /var/www/html/site.com/wp-content/plugins/next-active-directory-integration/logs/debug.log
(In case that Log4PHP needs execute permission, you have to execute:
sudo chmod +rwx /var/www/html/site.com/wp-content/plugins/next-active-directory-integration/logs/debug.log)

But changing the file permissions has the problem that everyone (on your system) can read the debug.log which contains the Active Directory DNS/IP address, the usernames etc.

The best solution might be that:

I have one more question. Why do you own all WordPress files/folders? Updating plugins or WordPress is much difficult.

from active-directory-integration2.

jpurpleman avatar jpurpleman commented on July 20, 2024

HI Tobi823,

Thanks for the response.

I know how to fix the issue via the command line, chmod and such. I update my development sites with wp-cli and then commit and push / pull changes into production. All my sites are under version control.

I think your solutions are a good start. Personally, I would only do the log writing based on the WordPress define WP_DEBUG being set to true. Also you might want to only want to write to the log when WP_DEBUG_LOG is also set to true.

https://codex.wordpress.org/WP_DEBUG

I'm assuming your plugin will be used by developers who have access to Active Directory therefore they would have the skills to turn on the constants if they need.

Otherwise, maybe a settings checkbox in the admin would be more user friendly to enable or disable the logging.

Thanks.

from active-directory-integration2.

schakko avatar schakko commented on July 20, 2024

Hi @jpurpleman and thank you for raising this issue!
We will weigh both solutions. Using WP_DEBUG_LOG requires us either to rewrite every log statement in each of the classes or adding a new appender for log4php.
Adding the configuration options ("Enable logging", "Path to log file") would be probably easier to implement.

from active-directory-integration2.

Tobi823 avatar Tobi823 commented on July 20, 2024

Hi @jpurpleman
we added the support to enable/disable the logging. Furthermore you can change the path to the log file. I hope that it helps. https://ps.w.org/next-active-directory-integration/assets/screenshot-10.png?rev=1502558

from active-directory-integration2.

brocheafoin avatar brocheafoin commented on July 20, 2024

I'm with @jpurpleman here. Log files don't belong in the plugin's directory. Most plugins thatneed to write to the filesystem (caching plugins for example) do it in their own subdirectory of wp-content/. Since you only need one file, it could/should be the default WP debug log file, IMHO.

I would also prefer the plugin to honor the WordPress WP_DEBUG and WP_DEBUG_LOG constants. That would be more standard than having your own configuration for this purpose.

Furthermore, I would like the ability to specify the plugin's log level via a constant. Right now, it's all or nothing and the all is pretty verbose. I'll try to submit a pull request with what I have in mind in the coming days.

from active-directory-integration2.

Tobi823 avatar Tobi823 commented on July 20, 2024

@brocheafoin Thanks for helping us out. But we make still changes to the Logger and upload the code changes as soon as possible.

I will inform you when these changes are online (only if you are still interested in creating a pull request or review our changes)

from active-directory-integration2.

brocheafoin avatar brocheafoin commented on July 20, 2024

FYI: since version 2.0.7, logging is disabled by default. It can be enabled in the configuration and a custom path to the log file can be set, which should be considered a resolution of this issue.

from active-directory-integration2.

schakko avatar schakko commented on July 20, 2024

This issue should be solved with latest 2.1.0 version.

from active-directory-integration2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.