You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "ppkarwasz (via GitHub)" <gi...@apache.org> on 2023/10/29 17:37:05 UTC

[PR] Add support for Log4j API and SLF4J [commons-logging]

ppkarwasz opened a new pull request, #177:
URL: https://github.com/apache/commons-logging/pull/177

   The logging backends supported by the default `LogFactoryImpl` have all reached their end-of-life (except JUL and `SimpleLog`). Third-generation logging backends, such as Log4j Core, support multiple logger contexts per application and therefore can not be handled by the simplified caching mechanism in `LogFactoryImpl`.
   
   This PR introduces two new `LogFactory` implementations, `Log4j2LogFactory` and `Slf4jLogFactory`, that forward messages to the Log4j API and SLF4J respectively.
   
   During initialization the three existing factories are checked in the following order:
    1. the `Log4j2LogFactory` has highest priority, since the Log4j API can faithfully transmit messages of type `Object`,
    2. the `Slf4jLogFactory` is the next choice. However, if the Log4j-to-SLF4J bridge is present we log directly to SLF4J instead of the Log4j API.
    3. the legacy `LogFactoryImpl` has lowest priority.
    
    All the messages produced by loggers from `Log4j2LogFactory` and `Slf4jLogFactory` are marked with a `COMMONS-LOGGING` marker.
    
    This PR also marks the old `Log4jLogger` class as deprecated.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add support for Log4j API and SLF4J [commons-logging]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory merged PR #177:
URL: https://github.com/apache/commons-logging/pull/177


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add support for Log4j API and SLF4J [commons-logging]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #177:
URL: https://github.com/apache/commons-logging/pull/177#issuecomment-1789935406

   > @garydgregory,
   > 
   > Could you take a look at this?
   
   @ppkarwasz 
   I should be able to get to it tomorrow hopefully. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add support for Log4j API and SLF4J [commons-logging]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #177:
URL: https://github.com/apache/commons-logging/pull/177#issuecomment-1792632365

   TY @ppkarwasz ! 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add support for Log4j API and SLF4J [commons-logging]

Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on PR #177:
URL: https://github.com/apache/commons-logging/pull/177#issuecomment-1789849340

   @garydgregory,
   
   Could you take a look at this?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org