
Hi guys, I'm looking for a full replacement to Logback in WildFly. I already added modules remove another ones and disabled log manager. Also I defined a default logback.xml and set it by property logback.configurationFile I was looking to work with JNDI context selector but as I see Loggers created from modules are attached to default LoggerContext and still after reuse from application classes My application logs works with the right contextSelector and consequentially the right appenders. But when I call some logger from modules, for example a query (SqlStatementLogger), its loggers are attached with default LoggerContext what selects the default appenders not application ones Is there a way to Logger dynamic select another context after it has been created? Has anyone made this work (as a full replacement)?

Hi guys, No updates here right? Let me share what I've done. Full replacement, I intended to remove all default log from wildfly and use only Logback. Also I wanted to have log separation as in http://logback.qos.ch/manual/loggingSeparation.html So to integrate better I've created a subsystem https://github.com/Janario/wildfly-logback-subsystem To use it I have to: - create a logback-default.xml that will be used by default context - from standalone.xml remove <extension module="org.jboss.as.logging"/> and all <subsystem xmlns="urn:jboss:domain:logging:2.0"> body More details of installation can be found here https://github.com/Janario/wildfly-logback-subsystem#install After integrate basically I've had 3 problems. Most of them is because some static Logger instances are loaded from startup and attached with default context logger. - Level by context After create Logger from default LoggerContext it still with same level. To make this more dynamic I've created a TurboFilter that wrap all other Filter. So from current LoggerContext if level is denied just deny, if level is accepted and other filters are neutral just accept, otherwise the result of others filters. see https://github.com/Janario/wildfly-logback-subsystem/blob/master/src/main/ja... With that I've made "contextual" level - Appender by context As in Level by context I've wrapped AppenderAttachableImpl and made decision based on current LoggerContext. But I've supported only root Logger. It would be difficult to replace all levels see https://github.com/Janario/wildfly-logback-subsystem/blob/master/src/main/ja... - Error on EJB async On async calls it throws a NullPointerException because of null from LogbackMDCAdapter.getCopyOfContextMap That one I have no way to make it work without change Logback. So, I know, work with wrapped instances is not the best way to work. I was just looking for some points to share here and discuss a better integration with Logback. Is this already planned by logback team? Is there other ways to integrate contextual loggers with logback? -- View this message in context: http://logback.10977.n7.nabble.com/Fwd-ContextSelector-JNDI-in-WildFly-tp141... Sent from the Users mailing list archive at Nabble.com.
participants (2)
-
Janario
-
Janario Oliveira