You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to normalize logs and log frameworks on my platform, I currently deploy docker images containing vert.x plus required jars and resources needed to make log4j 2.0 works.
To reproduce this environment on a developer workstation I put these resource in src/main/platform_lib directory (maven project).
When I run the module using plain vertx, I pass these options and obtain good results (ie. consistent logging) :
MAIN_PATH="src/main"
PLATFORM_PATH=${MAIN_PATH}/platform_lib/"RESOURCES_PATH=${MAIN_PATH}/resources/"# Define VERTX and CLASSPATH env vars
VERTX_OPTS="-Dorg.vertx.logger-delegate-factory-class-name=org.vertx.java.core.logging.impl.SLF4JLogDelegateFactory"
CLASSPATH="${PLATFORM_PATH}"for(jarin`ls -1 ${PLATFORM_PATH}/*.jar`);do
CLASSPATH="${CLASSPATH}:$jar";done# Run module
vertx runmod com.mycompany~my-module~0.1 -conf src/main/resources/my-module.json
But, trying to do the same with maven plugin via vertx:runMod, I fail in printing 95% of logs, probably because of maven embedded logger (3.0.5) or something like that :
Trying maven-3.2.3, it's a little better since it implements SLF4J vs. Plexus logging API (http://maven.apache.org/maven-logging.html), and probably for this reason I've no no more complains like that :
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
log4j:WARN No appenders could be found for logger (io.netty.util.internal.logging.InternalLoggerFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
But, typically, it doesn't take in account the log4j2.xml file in the classpath, and there are still some components that don't log anything.
If I do some operations in maven directories :
Remove the slf4j-simple jar and add log4j-core & log4j-api in "/lib",
Add a log4j2.xml in conf/logging
It seems to work.
It seems that maven logging configuration preempt any other given by an embedded vert.x core
May not be a bug, but any advice will be appreciated !
Trying to normalize logs and log frameworks on my platform, I currently deploy docker images containing vert.x plus required jars and resources needed to make log4j 2.0 works.
In detail :
To reproduce this environment on a developer workstation I put these resource in src/main/platform_lib directory (maven project).
When I run the module using plain vertx, I pass these options and obtain good results (ie. consistent logging) :
But, trying to do the same with maven plugin via vertx:runMod, I fail in printing 95% of logs, probably because of maven embedded logger (3.0.5) or something like that :
(It seems that the "main" module could not instantiate any logging implementation and/or bridges)
Debugging the plugin result in :
Any feedbacks on this subject ?
The text was updated successfully, but these errors were encountered: