[
https://issues.apache.org/jira/browse/LOG4PHP-234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16976740#comment-16976740
]
Kate Gray commented on LOG4PHP-234:
-----------------------------------
For your wordpress plugins, you wouldn't use the same WPPlugin base class - I
just did it to make the example easier.
Both plugins would call configure with an empty logger body, and each plugin
would be responsible for adding the appender to it's own logger. You probably
don't have a reason to do this, but each plugin could log to the other plugin's
log file by calling getLogger() with the name of the other plugin's logger.
It's possible to create a configuration that has the different loggers
outputting to different files, but the problem is the global nature of the
plugin and it's configuration. That's something I'll want to consider changing
in the next major revision of the plugin.
> Two plugin using log4php produces Fatal, although include_once used
> -------------------------------------------------------------------
>
> Key: LOG4PHP-234
> URL: https://issues.apache.org/jira/browse/LOG4PHP-234
> Project: Log4php
> Issue Type: Bug
> Environment: ubuntu LTS 16
> Reporter: Max UNGER
> Priority: Critical
>
> Two wordpress plugins on the same install using log4php, loaded as explained
> in doc produce fatal error when used together:
> PHP Fatal error: Cannot declare class LoggerAutoloader, because the name is
> already in use in
> /var/www/yyyyyyy.com/wp-content/plugins/myplugin/libs/log4php/2.3.0/LoggerAutoloader.php
> on line 34
> no change if include_once used instead of include
--
This message was sent by Atlassian Jira
(v8.3.4#803005)