Comments (9)
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.
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:
- Next ADI should check if the debug.log is writable
- if debug.log is not writable, then the LoggerAppenderConsole (http://logging.apache.org/log4php/docs/appenders/console.html) should be used for writing information to the apache/ngingx log.
What do you think jpurpleman?
I have one more question. Why do you own all WordPress files/folders? Updating plugins or WordPress is much difficult.
from active-directory-integration2.
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.
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.
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.
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.
@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.
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.
This issue should be solved with latest 2.1.0 version.
from active-directory-integration2.
Related Issues (20)
- NADI 2.3.6 login error on PHP 7.4.19 (parameter to be array, null given…) HOT 3
- Conflit with wp-rocket HOT 2
- Changing WordPress' AUTH_SALT leads to users not being able to login HOT 1
- Can't load or save settings after update - angular.js errors HOT 1
- Include PHP 8.2 into test suite
- "Dreitier\Nadi\Authentication\SingleSignOn\Ui\ShowSingleSignOnLink" not found when using SSO in NADI 3.0
- 'Uncaught Error: Class "Logger" not found...' for older versions of Premium Extensions with NADI 3.x
- Class Dreitier\Util\Logger\LogFacade not found with NADI 3.0.x HOT 1
- Websites crash on update HOT 2
- Updated NADI today. Critical website error HOT 3
- Conflict with The Events Calendar HOT 3
- Active directory attribute HOT 1
- WP_MS_Sites_List_Table not found when running in Multisite
- Error if timestamped LDAP attributes are empty or contain a string
- Twig functions in default namespace conflict with other WordPress plug-ins HOT 1
- `Dreitier\Ldap\Connection::filterDomainMembers` throws fatal error when invalid SID is returned
- Duplicate search for user by sAMAccountName during login
- Do not map local WordPress users if their meta value next_ad_int.objectGuid does not match with AD's objectGuid
- Drop PHP 8.0 support from CI
- Compatibility for system with samaccountname different from UPN HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from active-directory-integration2.