When I start the gradle build in one of my modules, it prints an error-message to std-error:
:m28_presentation_api:generateXtext
Error initializing JvmElement
That's not very helpful and I hope, that I can configure log4j to print more details about the exception. I think this message is logged by JvmTypesBuilder.initializeSafely()
LOG.error("Error initializing JvmElement", e);
Versions:
- I am using xtext 2.13: in the MANIFEST.MF file, I see the
- log4j version: 1.2.15
- gradle version: 4.6
- xtext-gradle-plugin version: 1.0.21
According to the log4j V1 docs, it should be enough when I add a log4j.properties
file to the classpath: so I just save this file in src/main/java
.
But it seems that this is not used/found - or maybe I did something wrong in the configuration file:
log4j.rootLogger=stderr
log4j.appender.stderr=org.apache.log4j.ConsoleAppender
log4j.appender.stderr.layout=org.apache.log4j.PatternLayout
# Pattern to output the caller's file name and line number.
log4j.appender.stderr.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
When I now start the build, I'd expect a different log-output for the error-message, but it prints the same message as before. So obviously my log-config is not used for some reasons.
What am I missing?
Or can someone maybe point me to an example project?
it looks like LOG.error() does not print a stacktrace by default. maybe you can actively change your code e.g.