Hi all;
I have implented a MicroProfile custom config source. it works great...
however, I canot seem to be able to log from the module code to any destination.
I have the following configuration:
module.xml
<module xmlns="urn:jboss:module:1.9" name="com.allot.mp">
<resources>
<resource-root path="."/>
</resources>
<dependencies>
<module name="org.eclipse.microprofile.config.api"/>
<module name="javax.api"/>
<module name="javax.xml.stream.api"/>
<module name="org.slf4j"/>
</dependencies>
</module> the dependencies work (without the slf4j dependency wildfly fails to start.
my custom donfig source code inside the module:
import org.eclipse.microprofile.config.spi.ConfigSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class JConfigStaxConfigSource implements ConfigSource{
...
public JConfigStaxConfigSource(){
Logger logger = LoggerFactory.getLogger(JConfigStaxConfigSource.class);
logger.info(" Hello World");// does not print anything
PrintWriter console = System.console().writer();
console.println("Creating XMLStaxConfigSource");//prints to console
console.println(logger);// actually prints the logger instance so its there
.....
}
in the <subsystem xmlns="urn:jboss:domain:logging:8.0"> I have tried to add roper config but I cant seem to be able to log from my module.
here it is:
<subsystem xmlns="urn:jboss:domain:logging:8.0">
<console-handler name="CONSOLE">
<level name="INFO"/>
<encoding value="UTF-8"/>
<formatter>
<named-formatter name="CONSOLE_PATTERN"/>
</formatter>
</console-handler>
<logger category="com.allot.nms.common.enterprise">
<level name="TRACE"/>
<handlers>
<handler name="CONSOLE"/>
</handlers>
</logger>
<root-logger>
<level name="WARN"/>
<handlers>
<handler name="CONSOLE"/>
</handlers>
</root-logger>
<formatter name="CONSOLE_PATTERN">
<pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c{1}] %m%n"/>
</formatter>
</subsystem>
I assume this is not a microprofile subsystem thing but more of a 'how to log from a wildfly module' which apperantly I cant find the way to achieve.
your help is appreciated.
thanks!