tomcat-slf4j-logback / tomcat-slf4j-logback Goto Github PK
View Code? Open in Web Editor NEWTomcat, SLF4J and Logback integration Releases
License: Eclipse Public License 1.0
Tomcat, SLF4J and Logback integration Releases
License: Eclipse Public License 1.0
It seems when using tomcat-juli-7.0.70-slf4j-1.7.21-logback-1.1.7.zip with Tomcat 7.0.70 the access log valve configuration is either not found or ignored when the specified path to logback-access.xml contains ${catalina.home}
. This is somewhat supported by the documentation, but it only says that ${catalina.home}
is no longer necessary, not that it prevents Tomcat from loading the specified logback-access.xml.
For reference, this is how we usually configure the access log valve for each of our Tomcat instances in server.xml (we use the separation between CATALINA_HOME and CATALINA_BASE to run multiple instances from one global CATALINA_HOME):
<Valve className="ch.qos.logback.access.tomcat.LogbackValve"
filename="${catalina.home}/conf/logback-access.xml"
quiet="true"
/>
This works for Tomcat < 7.0.69 and tomcat-slf4j-logback for these versions, but not with Tomcat 7.0.70 as specified above. No access log is written at all when the filename for logback-access.xml is specified like this.
If I remove ${catalina.home}
it works: the configuration file is found/loaded and access logs are written.
The problem is that we use multiple Tomcat and tomcat-slf4j-logback versions throughout our infrastructure, and manage them using Puppet. Previous versions of tomcat-slf4j-logback won't find logback-access.xml unless it is specified absolutely and/or with ${catalina.home}
, but current versions don't find the file unless ${catalina.home}
is not specified.
This makes it difficult or at least cumbersome to cater to the needs of different Tomcat/tomcat-slf4j-logback versions.
So I am asking: is it possible to fix up tomcat-slf4j-logback in such a way that the above access log valve definition works with newer versions as well? This way we can keep using filename="${catalina.home}/conf/logback-access.xml"
throughout our infrastructure and don't have to differentiate between older and newer versions of Tomcat/tomcat-slf4j-logback in this regard.
Does fact that logback-access does not directly support syslog affect this projects ability to make use of syslog too. (I see a SyslogAppender in tomcat-juli-logback-classic-1.0.11.jar supplied by this project)
Though I've added a syslog appender to logback.xml and the only logger left defined is "SYSLOG" I am not getting anything from tomcat in my syslog file. I believe I've followed the general instructions.
ubuntu 12.04, tomcat 7. tomcat-7.0.39-slf4j-1.7.5-logback-1.0.11.zip
Note: my application within tomcat is logging to syslog
Maybe you could build a release for Tomcat 8.5.8. It's out since 2016-11-08.
Thanks in advance.
Oliver
I had difficulties trying to build the project from the office.
The problem is related to proxy configuration. I'm used to face similar difficulties.
I found 4 solutions for the problem, as explained below:
Turned out that only option (4) worked for me.
All other options failed. I even installed recent versions of Ant and the JDK. Nothing.
In the Ant website there's a suggestion about how proxy configuration could be included in the configuration. More details: http://ant.apache.org/manual/proxy.html
if you had a chance to implement, it would be nice to have.
Thanks a lot ;)
By default, all console output is logged into a file called logs\catalina.out
.
If I'm using your library, any method to relay those logs to default catalina.log.*
files?
If it still gonna go to catalina.out
, can it be rolled?
Hello,
the newest tomcat package is missing.
Should 7.0.69 work with the newer one?
Thanks!
Great library, many thanks for making tomcat logging much better.
This isn't an issue but a query. How do I change the log pattern of the logback messages. i.e. these appear in stdout but I'm not sure where to configure their pattern:
19:13:20,935 |-INFO in org.apache.juli.logging.ch.qos.logback.classic.LoggerContext[default] - Found resource [C:\opt\tomcat90\conf\logback.xml] at [file:/C:/opt/tomcat90/conf/logback.xml] 19:13:20,995 |-INFO in org.apache.juli.logging.ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [org.apache.juli.logging.ch.qos.logback.core.ConsoleAppender]
I was following standard instructions to configure tomcat 7.0.86,
everything was okay but access log.
finally, I found it's a missing line in logback-access.xml:
<statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" />
Please refer to official recommendation:
https://logback.qos.ch/access.html#configuration
I've specified log4j.version=1.7.0 in build.properties.default but ivywork.xml has it hardcoded as version 1.7.2.
The build failed due to this reason.
It would be ideal if the build script would create ivywork.xml on the fly, instead of relying on something already there.
Thanks :)
We should have the git revision listed but it's missing. Need to figure out what caused this to occur and fix it.
Here is jira for sync to central using new coordinates here
The file 'setenv.sh' contains '\r\n' instead of '\n', so the current configuration doesn't work on Linux 😞
With the tomcat-juli logging a println statement would be logged to the catalina.log file, but this does not happen with this implementation (tomcat-7.0.42).
Here https://github.com/tomcat-slf4j-logback/tomcat-slf4j-logback/blob/master/pom.xml#L86-L105 I can see a list of license that comes from upstream projects. But neither in source code neither in README.md I can't find that the license of tomcat-slf4j-logback project itself. Could you please clarify this in source code or README.md.
While direct usage probably would not benefit from this there are instances were certain companies are enforcing getting artifacts only out of central. This would assist in those situations to ensure we do not need to manually load to a nexus repo. I do have a sonatype account and can move things there if that would help in getting that going.
Hello. Thanks for the hard work. I'm not super familiar with Ivy+Maven interop, and I'm hoping it's not difficult-
I'd love to be able to upload this to my Maven server & rely on it alike any other Maven resource.
I am aware this needs to be put in tomcat's lib/ folder, not merely be captured by the Jar, but having it live in standard Maven repos would be much appreciated.
I'm slowly chunking through http://draconianoverlord.com/2010/07/18/publishing-to-maven-repos-with-ivy.html which- it's hard to tell- I think purports to help achieve this effect, but Ivy is all new to me and this is a fairly complicated configuration file.
The tomcat defalut log configuration has the level Fine , but when i add logback for tomcat log accroding to tomcat-slf4j-logback, we found that we useed the logback.xml to config the tomcat catalina.log,localhost.log and other logs , all the level for these tomcat log are INFO,I kown this may caused that logback didn't has the level FINE. But when we config completed as tomcat-slf4j-logback tutorials and start the tomcat , we find we missing some tomcat log which shoud be have . I want to know tomcat defalut log has more level relative to logback ,such as level FINE, whether we
will lose some tomcat log which the log level logback not has ?
Hi, @hazendaz
When using FixedWindowRollingPolicy with straight forward configuration,
it sometimes writes over than the configured size files (20MB in my specific configuration [true for bigger sizes as well]), and sometimes I see that catalina.1.log (which isn't active file) is still being written to.
I've made sure no other process or webapp access this log. Also, tested the same logback version (1.1.7) with other plain java / webapp reporting massive amount of logs, and they all rolled over around 20.0 MB or 20.1 MB at most.
This once almost filled my disk.
Is easily produceble with 1MB and setting log level to DEBUG. Version: 8.5.6-with-logback-1.1.7
The configuration:
${MY_HOME}/logs/tomcat/catalina.log ${MY_HOME}/logs/tomcat/catalina.%i.log 1 10<triggeringPolicy class="org.apache.juli.logging.ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>20MB</MaxFileSize>
</triggeringPolicy>
<encoder>
<pattern>[%d{dd-MM HH:mm:ss.SSS}][-------TOMCAT------] %-5level - %msg {%logger{0}} [%thread] %n</pattern>
</encoder>
We need to break this into multiple projects. The tomcat releases are never in sync these day so it's hard to just wait to all catch up before releases. Also the parent ends up getting changed in the current way for mostly no reason. so we need to split this from a multi module build into separate projects. This also would alot for bringing back tomcat 6 since it got some updates we since have ignored.
@grgrzybek I think we should move this to an organization. Simply 'tomcat-slf4j-logback' should do it. I can do majority of work then can invite you over. At that point you would need to transfer ownership over. What do you think?
This approach in turn can result in groupId for maven central releases to change to 'com.github.tomcat-slf4j-logback'. It additionally will give me a bit of extra access so I can do things like properly hook this to travis CI and versioneye rather than off my personal account. That in turn allows some additional build configurations to occur like most recent commit I added to auto release snapshots to sonatype (tied to root repo).
Hi!
Could you please build new releases for recent versions of Tomcat?
8.5.37
9.0.14
Tomcat Version: 9.0.2
We are using slf4j in the webapp and we followed the guide on the github project but when we start tomcat we get a IncompatibleClassException
Inside the apache-tomcat-9.0.2/lib/
bash-4.2$ ll /opt/apache-tomcat-9.0.2/lib/
total 9916
-rw-rw-rw- 1 tomcat tomcat 12400 Jun 21 16:35 annotations-api.jar
-rw-rw-rw- 1 tomcat tomcat 54234 Jun 21 16:35 catalina-ant.jar
-rw-rw-rw- 1 tomcat tomcat 119168 Jun 21 16:35 catalina-ha.jar
-rw-rw-rw- 1 tomcat tomcat 1610515 Jun 21 16:35 catalina.jar
-rw-rw-rw- 1 tomcat tomcat 74886 Jun 21 16:35 catalina-storeconfig.jar
-rw-rw-rw- 1 tomcat tomcat 287047 Jun 21 16:35 catalina-tribes.jar
-rw-r--r-- 1 tomcat tomcat 61829 Aug 6 13:48 commons-logging-1.2.jar
-rw-rw-rw- 1 tomcat tomcat 2450404 Jun 21 16:35 ecj-4.6.3.jar
-rwxr-xr-x 1 tomcat tomcat 1347501 Aug 1 11:34 ehcache-core-2.6.11.jar
-rw-rw-rw- 1 tomcat tomcat 81580 Jun 21 16:35 el-api.jar
-rw-rw-rw- 1 tomcat tomcat 163672 Jun 21 16:35 jasper-el.jar
-rw-rw-rw- 1 tomcat tomcat 547145 Jun 21 16:35 jasper.jar
-rw-rw-rw- 1 tomcat tomcat 26870 Jun 21 16:35 jaspic-api.jar
-rw-rw-rw- 1 tomcat tomcat 61763 Jun 21 16:35 jsp-api.jar
-rw-r--r-- 1 tomcat tomcat 107064 Aug 2 14:44 logback-access-1.2.3.jar
-rw-r--r-- 1 tomcat tomcat 290339 Aug 9 10:26 logback-classic-1.2.3.jar
-rw-r--r-- 1 tomcat tomcat 471901 Aug 9 09:39 logback-core-1.2.3.jar
-rw-rw-rw- 1 tomcat tomcat 277812 Jun 21 16:35 servlet-api.jar
-rw-r--r-- 1 tomcat tomcat 41203 Aug 2 09:22 slf4j-api-1.7.25.jar
-rw-rw-rw- 1 tomcat tomcat 10700 Jun 21 16:35 tomcat-api.jar
-rw-rw-rw- 1 tomcat tomcat 802899 Jun 21 16:35 tomcat-coyote.jar
-rw-rw-rw- 1 tomcat tomcat 251938 Jun 21 16:35 tomcat-dbcp.jar
-rw-rw-rw- 1 tomcat tomcat 65453 Jun 21 16:35 tomcat-i18n-es.jar
-rw-rw-rw- 1 tomcat tomcat 39392 Jun 21 16:35 tomcat-i18n-fr.jar
-rw-rw-rw- 1 tomcat tomcat 42275 Jun 21 16:35 tomcat-i18n-ja.jar
-rw-rw-rw- 1 tomcat tomcat 145142 Jun 21 16:35 tomcat-jdbc.jar
-rw-rw-rw- 1 tomcat tomcat 34541 Jun 21 16:35 tomcat-jni.jar
-rw-rw-rw- 1 tomcat tomcat 136862 Jun 21 16:35 tomcat-util.jar
-rw-rw-rw- 1 tomcat tomcat 205736 Jun 21 16:35 tomcat-util-scan.jar
-rw-rw-rw- 1 tomcat tomcat 224847 Jun 21 16:35 tomcat-websocket.jar
-rw-rw-rw- 1 tomcat tomcat 36829 Jun 21 16:35 websocket-api.jar
Output of mvn dependency:tree
[INFO] Reactor Build Order:
[INFO]
[INFO] ORTS Parent pom [pom]
[INFO] ORTS-XMLBeans [jar]
[INFO] ORTS web application [war]
[INFO]
[INFO] ------------------< com.cliqdigital.orts:orts-parent >------------------
[INFO] Building ORTS Parent pom 3.6.0-SNAPSHOT [1/3]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ orts-parent ---
[INFO] com.cliqdigital.orts:orts-parent:pom:3.6.0-SNAPSHOT
[INFO]
[INFO] -----------------< com.cliqdigital.orts:ORTS-XMLBeans >-----------------
[INFO] Building ORTS-XMLBeans 3.6.0-SNAPSHOT [2/3]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ ORTS-XMLBeans ---
[INFO] com.cliqdigital.orts:ORTS-XMLBeans:jar:3.6.0-SNAPSHOT
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.9.3:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-core:jar:2.9.3:compile
[INFO] +- javax.validation:validation-api:jar:2.0.1.Final:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.7:compile
[INFO] \- org.jvnet.jaxb2_commons:jaxb2-basics-runtime:jar:1.11.1:compile
[INFO]
[INFO] -------------------< com.cliqdigital.orts:ORTS-web >--------------------
[INFO] Building ORTS web application 3.6.0-SNAPSHOT [3/3]
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ ORTS-web ---
[INFO] com.cliqdigital.orts:ORTS-web:war:3.6.0-SNAPSHOT
[INFO] +- com.cliqdigital.orts:ORTS-XMLBeans:jar:3.6.0-SNAPSHOT:compile
[INFO] | +- javax.validation:validation-api:jar:2.0.1.Final:compile
[INFO] | \- org.jvnet.jaxb2_commons:jaxb2-basics-runtime:jar:1.11.1:compile
[INFO] +- javax.enterprise:cdi-api:jar:2.0:provided
[INFO] | +- javax.el:javax.el-api:jar:3.0.0:provided
[INFO] | +- javax.interceptor:javax.interceptor-api:jar:1.2:provided
[INFO] | \- javax.inject:javax.inject:jar:1:provided
[INFO] +- javax.annotation:jsr250-api:jar:1.0:provided
[INFO] +- org.apache.commons:commons-lang3:jar:3.7:compile
[INFO] +- org.javassist:javassist:jar:3.22.0-GA:compile
[INFO] +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | \- xml-apis:xml-apis:jar:1.0.b2:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.9.3:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-core:jar:2.9.3:compile
[INFO] +- commons-io:commons-io:jar:2.6:compile
[INFO] +- commons-codec:commons-codec:jar:1.11:compile
[INFO] +- commons-validator:commons-validator:jar:1.6:compile
[INFO] | +- commons-beanutils:commons-beanutils:jar:1.9.2:compile
[INFO] | +- commons-digester:commons-digester:jar:1.8.1:compile
[INFO] | \- commons-collections:commons-collections:jar:3.2.2:compile
[INFO] +- org.apache.httpcomponents:httpclient:jar:4.5.4:compile
[INFO] | \- org.apache.httpcomponents:httpcore:jar:4.4.7:compile
[INFO] +- org.quartz-scheduler:quartz:jar:2.3.0:compile
[INFO] | +- com.mchange:c3p0:jar:0.9.5.2:compile
[INFO] | +- com.mchange:mchange-commons-java:jar:0.2.11:compile
[INFO] | \- com.zaxxer:HikariCP-java6:jar:2.3.13:compile
[INFO] +- log4j:log4j:jar:1.2.17:provided
[INFO] +- junit:junit:jar:4.12:test
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.easymock:easymock:jar:3.5.1:test
[INFO] | \- org.objenesis:objenesis:jar:2.6:test
[INFO] +- org.easymock:easymockclassextension:jar:3.2:test
[INFO] +- cglib:cglib-nodep:jar:3.2.5:test
[INFO] +- org.springframework:spring-test:jar:4.3.13.RELEASE:test
[INFO] +- org.springframework:spring-beans:jar:4.3.13.RELEASE:compile
[INFO] +- org.springframework:spring-context:jar:4.3.13.RELEASE:compile
[INFO] +- org.springframework:spring-context-support:jar:4.3.13.RELEASE:compile
[INFO] +- org.springframework:spring-core:jar:4.3.13.RELEASE:compile
[INFO] +- org.springframework:spring-expression:jar:4.3.13.RELEASE:compile
[INFO] +- org.springframework:spring-web:jar:4.3.13.RELEASE:compile
[INFO] +- org.springframework:spring-webmvc:jar:4.3.13.RELEASE:compile
[INFO] +- org.springframework:spring-orm:jar:4.3.13.RELEASE:compile
[INFO] +- org.springframework:spring-oxm:jar:4.3.13.RELEASE:compile
[INFO] +- org.springframework:spring-tx:jar:4.3.13.RELEASE:compile
[INFO] +- org.springframework:spring-jdbc:jar:4.3.13.RELEASE:compile
[INFO] +- org.springframework:spring-aop:jar:4.3.13.RELEASE:compile
[INFO] +- org.springframework:spring-aspects:jar:4.3.13.RELEASE:compile
[INFO] +- org.springframework.ws:spring-ws-core:jar:3.0.0.RELEASE:compile
[INFO] | \- org.springframework.ws:spring-xml:jar:3.0.0.RELEASE:compile
[INFO] +- org.springframework.integration:spring-integration-core:jar:4.3.13.RELEASE:compile
[INFO] | +- org.springframework:spring-messaging:jar:4.3.13.RELEASE:compile
[INFO] | \- org.springframework.retry:spring-retry:jar:1.1.3.RELEASE:compile
[INFO] +- org.springframework.integration:spring-integration-http:jar:4.3.13.RELEASE:compile
[INFO] +- org.springframework.integration:spring-integration-xml:jar:4.3.13.RELEASE:compile
[INFO] +- org.springframework.integration:spring-integration-ws:jar:4.3.13.RELEASE:compile
[INFO] +- org.springframework.integration:spring-integration-jmx:jar:4.3.13.RELEASE:compile
[INFO] +- org.springframework.integration:spring-integration-jms:jar:4.3.13.RELEASE:compile
[INFO] | \- org.springframework:spring-jms:jar:4.3.13.RELEASE:compile
[INFO] +- org.springframework.integration:spring-integration-amqp:jar:4.3.13.RELEASE:compile
[INFO] | \- org.springframework.amqp:spring-rabbit:jar:1.6.11.RELEASE:compile
[INFO] | +- com.rabbitmq:http-client:jar:1.0.0.RELEASE:compile
[INFO] | +- org.springframework.amqp:spring-amqp:jar:1.6.11.RELEASE:compile
[INFO] | \- com.rabbitmq:amqp-client:jar:3.6.5:compile
[INFO] +- org.springframework.security:spring-security-config:jar:4.2.3.RELEASE:compile
[INFO] | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] +- org.springframework.security:spring-security-web:jar:4.2.3.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-core:jar:4.2.3.RELEASE:compile
[INFO] +- org.springframework.integration:spring-integration-file:jar:4.3.13.RELEASE:compile
[INFO] +- org.springframework.integration:spring-integration-jpa:jar:4.3.13.RELEASE:compile
[INFO] +- org.codehaus.fabric3.api:commonj:jar:1.1.1:compile
[INFO] +- commons-jxpath:commons-jxpath:jar:1.3:compile
[INFO] +- com.googlecode.json-simple:json-simple:jar:1.1:compile
[INFO] +- joda-time:joda-time:jar:2.2:compile
[INFO] +- org.powermock:powermock-module-junit4:jar:1.7.3:test
[INFO] | \- org.powermock:powermock-module-junit4-common:jar:1.7.3:test
[INFO] | +- org.powermock:powermock-reflect:jar:1.7.3:test
[INFO] | \- org.powermock:powermock-core:jar:1.7.3:test
[INFO] +- org.powermock:powermock-api-easymock:jar:1.7.3:test
[INFO] | \- org.powermock:powermock-api-support:jar:1.7.3:test
[INFO] +- mysql:mysql-connector-java:jar:5.1.45:compile
[INFO] +- javax.servlet:javax.servlet-api:jar:4.0.0:provided
[INFO] +- net.sf.ehcache:ehcache-core:jar:2.6.11:provided
[INFO] +- org.apache.xbean:xbean-spring:jar:4.6:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.7.25:provided
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.7.25:provided
[INFO] +- ch.qos.logback:logback-classic:jar:1.2.3:provided
[INFO] +- ch.qos.logback:logback-core:jar:1.2.3:provided
[INFO] +- ch.qos.logback:logback-access:jar:1.2.3:provided
[INFO] +- org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile
[INFO] | \- org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile
[INFO] +- org.hibernate:hibernate-core:jar:5.2.12.Final:compile
[INFO] | +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
[INFO] | +- antlr:antlr:jar:2.7.7:compile
[INFO] | +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:1.0.1.Final:compile
[INFO] | +- org.jboss:jandex:jar:2.0.3.Final:compile
[INFO] | \- com.fasterxml:classmate:jar:1.3.0:compile
[INFO] +- org.mockito:mockito-all:jar:2.0.2-beta:test
[INFO] +- org.powermock:powermock-api-mockito:jar:1.7.3:test
[INFO] | \- org.powermock:powermock-api-mockito-common:jar:1.7.3:test
[INFO] +- trove:trove:jar:2.1.1:test
[INFO] +- cglib:cglib:jar:3.2.5:test
[INFO] | +- org.ow2.asm:asm:jar:5.2:test
[INFO] | \- org.apache.ant:ant:jar:1.9.6:test
[INFO] | \- org.apache.ant:ant-launcher:jar:1.9.6:test
[INFO] +- org.hsqldb:hsqldb:jar:2.3.1:test
[INFO] +- xmlunit:xmlunit:jar:1.3:test
[INFO] +- org.jvnet.jaxb2_commons:jaxb2-basics:jar:0.6.5:compile
[INFO] | +- org.jvnet.jaxb2_commons:jaxb2-basics-tools:jar:0.6.5:compile
[INFO] | | \- commons-lang:commons-lang:jar:2.2:compile
[INFO] | \- com.google.code.javaparser:javaparser:jar:1.0.8:compile
[INFO] +- javax.xml.ws:jaxws-api:jar:2.3.0:compile
[INFO] | +- javax.xml.bind:jaxb-api:jar:2.3.0:compile
[INFO] | \- javax.xml.soap:javax.xml.soap-api:jar:1.4.0:compile
[INFO] +- com.sun.xml.ws:jaxws-rt:jar:2.3.0:compile
[INFO] | +- javax.annotation:javax.annotation-api:jar:1.3:compile
[INFO] | +- javax.jws:jsr181-api:jar:1.0-MR1:compile
[INFO] | +- com.sun.xml.bind:jaxb-core:jar:2.3.0:compile
[INFO] | +- com.sun.xml.bind:jaxb-impl:jar:2.3.0:compile
[INFO] | +- com.sun.xml.ws:policy:jar:2.7.2:compile
[INFO] | +- org.glassfish.gmbal:gmbal-api-only:jar:3.1.0-b001:compile
[INFO] | | \- org.glassfish.external:management-api:jar:3.0.0-b012:compile
[INFO] | +- org.jvnet.staxex:stax-ex:jar:1.7.8:compile
[INFO] | +- com.sun.xml.stream.buffer:streambuffer:jar:1.5.4:compile
[INFO] | +- org.jvnet.mimepull:mimepull:jar:1.9.7:compile
[INFO] | +- com.sun.xml.fastinfoset:FastInfoset:jar:1.2.13:compile
[INFO] | +- org.glassfish.ha:ha-api:jar:3.1.9:compile
[INFO] | +- org.codehaus.woodstox:woodstox-core-asl:jar:4.4.1:runtime
[INFO] | +- org.codehaus.woodstox:stax2-api:jar:3.1.4:runtime
[INFO] | \- com.sun.org.apache.xml.internal:resolver:jar:20050927:compile
[INFO] +- com.sun.xml.ws:jaxws-tools:jar:2.3.0:compile
[INFO] | +- com.sun.xml.bind:jaxb-xjc:jar:2.3.0:compile
[INFO] | \- com.sun.xml.bind:jaxb-jxc:jar:2.3.0:compile
[INFO] +- com.sun.xml.parsers:jaxp-ri:jar:1.4.5:compile
[INFO] | \- javax.xml.parsers:jaxp-api:jar:1.4.5:compile
[INFO] +- com.sun.xml.messaging.saaj:saaj-impl:jar:1.4.0:provided
[INFO] +- org.apache.xmlrpc:xmlrpc-client:jar:3.1.3:compile
[INFO] | \- org.apache.xmlrpc:xmlrpc-common:jar:3.1.3:compile
[INFO] | \- org.apache.ws.commons.util:ws-commons-util:jar:1.0.2:compile
[INFO] +- commons-net:commons-net:jar:3.6:compile
[INFO] +- com.sun.istack:istack-commons-runtime:jar:3.0.5:test
[INFO] +- commons-logging:commons-logging:jar:1.2:compile
[INFO] +- org.mortbay.jetty:jetty:jar:6.1.5:test
[INFO] | +- org.mortbay.jetty:jetty-util:jar:6.1.5:test
[INFO] | \- org.mortbay.jetty:servlet-api-2.5:jar:6.1.5:test
[INFO] +- com.sun.jersey:jersey-client:jar:1.16:compile
[INFO] | \- com.sun.jersey:jersey-core:jar:1.16:compile
[INFO] +- org.aspectj:aspectjweaver:jar:1.8.13:compile
[INFO] +- org.aspectj:aspectjrt:jar:1.8.13:compile
[INFO] +- org.projectlombok:lombok:jar:1.16.6:compile
[INFO] +- org.antlr:antlr4-runtime:jar:4.5.3:compile
[INFO] +- org.assertj:assertj-core:jar:3.9.1:test
[INFO] \- org.mockito:mockito-core:jar:2.18.0:test
[INFO] +- net.bytebuddy:byte-buddy:jar:1.8.3:test
[INFO] \- net.bytebuddy:byte-buddy-agent:jar:1.8.3:test
[INFO] ------------------------------------------------------------------------
logback.xml
<configuration>
<property name="max.retention.days" value="60" />
<appender name="CONSOLE" class="org.apache.juli.logging.ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} %-5level {%thread} [%logger{20}] : %msg%n</pattern>
</encoder>
</appender>
<appender name="FILE" class="org.apache.juli.logging.ch.qos.logback.core.rolling.RollingFileAppender">
<file>${catalina.base}/logs/orts.log</file>
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
<rollingPolicy class="org.apache.juli.logging.ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${catalina.base}/logs/orts.%d{yyyy-MM-dd}.log</fileNamePattern>
</rollingPolicy>
</appender>
<appender name="FILE-CATALINA" class="org.apache.juli.logging.ch.qos.logback.core.rolling.RollingFileAppender">
<file>${catalina.base}/logs/catalina.log</file>
<append>true</append>
<encoder>
<charset>utf-8</charset>
<pattern>%d{HH:mm:ss.SSS} %-5level {%thread} [%logger{40}] : %msg%n</pattern>
</encoder>
<rollingPolicy class="org.apache.juli.logging.ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${catalina.base}/logs/archive/catalina-%d{yyyyMMdd}-%i.log.zip</fileNamePattern>
<maxHistory>${max.retention.days}</maxHistory>
<cleanHistoryOnStart>true</cleanHistoryOnStart>
<maxFileSize>20MB</maxFileSize>
</rollingPolicy>
</appender>
<appender name="FILE-LOCALHOST" class="org.apache.juli.logging.ch.qos.logback.core.rolling.RollingFileAppender">
<file>${catalina.base}/logs/localhost.log</file>
<append>true</append>
<encoder>
<charset>utf-8</charset>
<pattern>%d{HH:mm:ss.SSS} %logger{0} {%thread} %level : %msg%n</pattern>
</encoder>
<rollingPolicy class="org.apache.juli.logging.ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${catalina.base}/logs/archive/localhost-%d{yyyyMMdd}-%i.log.zip</fileNamePattern>
<maxHistory>${max.retention.days}</maxHistory>
<maxFileSize>20MB</maxFileSize>
</rollingPolicy>
</appender>
<appender name="FILE-MANAGER" class="org.apache.juli.logging.ch.qos.logback.core.rolling.RollingFileAppender">
<file>${catalina.base}/logs/manager.log</file>
<append>true</append>
<encoder>
<charset>utf-8</charset>
<pattern>%d{HH:mm:ss.SSS} %logger{0} {%thread} %level : %msg%n</pattern>
</encoder>
<rollingPolicy class="org.apache.juli.logging.ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${catalina.base}/logs/archive/manager-%d{yyyyMMdd}-%i.log.zip</fileNamePattern>
<maxHistory>${max.retention.days}</maxHistory>
<maxFileSize>20MB</maxFileSize>
</rollingPolicy>
</appender>
<appender name="FILE-HOST-MANAGER" class="org.apache.juli.logging.ch.qos.logback.core.rolling.RollingFileAppender">
<file>${catalina.base}/logs/host-manager.log</file>
<append>true</append>
<encoder>
<charset>utf-8</charset>
<pattern>%d{HH:mm:ss.SSS} %logger{0} {%thread} %level : %msg%n</pattern>
</encoder>
<rollingPolicy class="org.apache.juli.logging.ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${catalina.base}/logs/archive/host-manager-%d{yyyyMMdd}-%i.log.zip</fileNamePattern>
<maxHistory>${max.retention.days}</maxHistory>
<maxFileSize>20MB</maxFileSize>
</rollingPolicy>
</appender>
<logger name="org.apache.catalina" level="INFO" additivity="false">
<appender-ref ref="FILE-CATALINA" />
</logger>
<logger name="org.apache.catalina.core.ContainerBase.[Catalina]" level="DEBUG" additivity="false">
<appender-ref ref="FILE-LOCALHOST" />
</logger>
<logger name="org.apache.catalina.core.ContainerBase.[Catalina].[/manager]" level="INFO"
additivity="false">
<appender-ref ref="FILE-MANAGER" />
</logger>
<logger name="org.apache.catalina.core.ContainerBase.[Catalina].[/host-manager]" level="INFO"
additivity="false">
<appender-ref ref="FILE-HOST-MANAGER" />
</logger>
<logger name="com.cliqdigital" level="DEBUG" additivity="false">
<appender-ref ref="FILE" />
</logger>
<logger name="org.apache.juli" level="DEBUG" additivity="false">
<appender-ref ref="FILE" />
</logger>
<logger name="org.springframework" level="INFO" additivity="false">
<appender-ref ref="FILE" />
</logger>
<root level="INFO">
<appender-ref ref="CONSOLE" />
<appender-ref ref="FILE" />
</root>
</configuration>
server.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" at this level.
Documentation at /docs/config/server.html
-->
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener" />
<!-- Security listener. Documentation at /docs/config/listeners.html
<Listener className="org.apache.catalina.security.SecurityListener" />
-->
<!--APR library loader. Documentation at /docs/apr.html -->
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
-->
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
<!--Resource name="jdbc/FSPDS" auth="Container" type="javax.sql.DataSource"
maxTotal="100" maxIdle="30" maxWaitMillis="10000"
username="root" password="" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://adezorzi.dev.cliqdigital.com:3306/Q?zeroDateTimeBehavior=convertToNull&jdbcCompliantTruncation=false"/>
<Resource name="jdbc/ORTSMasterDS" auth="Container" type="javax.sql.DataSource"
maxTotal="100" maxIdle="30" maxWaitMillis="10000"
username="root" password="" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://adezorzi.dev.cliqdigital.com:3306/Q?zeroDateTimeBehavior=convertToNull&jdbcCompliantTruncation=false"/-->
</GlobalNamingResources>
<!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" Note: A "Service" is not itself a "Container",
so you may not define subcomponents such as "Valves" at this level.
Documentation at /docs/config/service.html
-->
<Service name="Catalina">
<!--The connectors can use a shared executor, you can define one or more named thread pools-->
<!--
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
maxThreads="150" minSpareThreads="4"/>
-->
<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Documentation at :
Java HTTP Connector: /docs/config/http.html
Java AJP Connector: /docs/config/ajp.html
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL/TLS HTTP/1.1 Connector on port 8080
-->
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
-->
<!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443
This connector uses the NIO implementation. The default
SSLImplementation will depend on the presence of the APR/native
library and the useOpenSSL attribute of the
AprLifecycleListener.
Either JSSE or OpenSSL style configuration may be used regardless of
the SSLImplementation selected. JSSE style configuration is used below.
-->
<!--
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true">
<SSLHostConfig>
<Certificate certificateKeystoreFile="conf/localhost-rsa.jks"
type="RSA" />
</SSLHostConfig>
</Connector>
-->
<!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443 with HTTP/2
This connector uses the APR/native implementation which always uses
OpenSSL for TLS.
Either JSSE or OpenSSL style configuration may be used. OpenSSL style
configuration is used below.
-->
<!--
<Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
maxThreads="150" SSLEnabled="true" >
<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
<SSLHostConfig>
<Certificate certificateKeyFile="conf/localhost-rsa-key.pem"
certificateFile="conf/localhost-rsa-cert.pem"
certificateChainFile="conf/localhost-rsa-chain.pem"
type="RSA" />
</SSLHostConfig>
</Connector>
-->
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host).
Documentation at /docs/config/engine.html -->
<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
-->
<Engine name="Catalina" defaultHost="localhost">
<!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
<!--
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-->
<!-- Use the LockOutRealm to prevent attempts to guess user passwords
via a brute-force attack -->
<Realm className="org.apache.catalina.realm.LockOutRealm">
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="ch.qos.logback.access.tomcat.LogbackValve" quiet="true" />
</Host>
</Engine>
</Service>
</Server>
setenv.sh
JAVA_OPTS="$JAVA_OPTS -Djuli-logback.configurationFile=$CATALINA_HOME/conf/logback.xml"
$CATALINA_HOME/conf/logging.properties
is been deleted
And this is the Exception we get:
10:42:07.734 INFO {main} [o.a.c.h.Http11NioProtocol] : Initializing ProtocolHandler ["http-nio-8080"]
10:42:07.743 INFO {main} [o.a.t.u.n.NioSelectorPool] : Using a shared selector for servlet write/read
10:42:07.748 INFO {main} [o.a.c.a.AjpNioProtocol] : Initializing ProtocolHandler ["ajp-nio-8009"]
10:42:07.749 INFO {main} [o.a.t.u.n.NioSelectorPool] : Using a shared selector for servlet write/read
10:42:10.090 INFO {main} [o.a.j.s.TldScanner] : At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
10:42:10,111 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
10:42:10,111 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
10:42:10,111 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/opt/apache-tomcat-9.0.2/conf/logback.xml]
10:42:10,117 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
10:42:10,117 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [org.apache.juli.logging.ch.qos.logback.core.ConsoleAppender]
10:42:10,118 |-ERROR in ch.qos.logback.core.joran.action.AppenderAction - Could not create an Appender of type [org.apache.juli.logging.ch.qos.logback.core.ConsoleAppender]. ch.qos.logback.core.util.IncompatibleClassException
at ch.qos.logback.core.util.IncompatibleClassException
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:58)
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassName(OptionHelper.java:45)
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassName(OptionHelper.java:34)
at at ch.qos.logback.core.joran.action.AppenderAction.begin(AppenderAction.java:52)
at at ch.qos.logback.core.joran.spi.Interpreter.callBeginAction(Interpreter.java:269)
at at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:145)
at at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:128)
at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:50)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:165)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:152)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:110)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:53)
at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
at at ch.qos.logback.classic.util.StatusViaSLF4JLoggerFactory.addStatus(StatusViaSLF4JLoggerFactory.java:32)
at at ch.qos.logback.classic.util.StatusViaSLF4JLoggerFactory.addInfo(StatusViaSLF4JLoggerFactory.java:20)
at at ch.qos.logback.classic.servlet.LogbackServletContainerInitializer.onStartup(LogbackServletContainerInitializer.java:32)
at at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5094)
at at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:740)
at at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:716)
at at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703)
at at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:619)
at at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1829)
at at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
at at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:530)
at at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:429)
at at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1575)
at at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:308)
at at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424)
at at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367)
at at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:964)
at at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
at at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
at at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
at at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)
at at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
at at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at at org.apache.catalina.startup.Catalina.start(Catalina.java:671)
at at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at at java.lang.reflect.Method.invoke(Method.java:497)
at at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:353)
at at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:493)
10:42:10,118 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@19:98 - ActionException in Action for tag [appender] ch.qos.logback.core.joran.spi.ActionException: ch.qos.logback.core.util.IncompatibleClassException
at ch.qos.logback.core.joran.spi.ActionException: ch.qos.logback.core.util.IncompatibleClassException
at at ch.qos.logback.core.joran.action.AppenderAction.begin(AppenderAction.java:76)
at at ch.qos.logback.core.joran.spi.Interpreter.callBeginAction(Interpreter.java:269)
at at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:145)
at at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:128)
at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:50)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:165)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:152)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:110)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:53)
at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
at at ch.qos.logback.classic.util.StatusViaSLF4JLoggerFactory.addStatus(StatusViaSLF4JLoggerFactory.java:32)
at at ch.qos.logback.classic.util.StatusViaSLF4JLoggerFactory.addInfo(StatusViaSLF4JLoggerFactory.java:20)
at at ch.qos.logback.classic.servlet.LogbackServletContainerInitializer.onStartup(LogbackServletContainerInitializer.java:32)
at at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5094)
at at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:740)
at at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:716)
at at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703)
at at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:619)
at at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1829)
at at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
at at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:530)
at at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:429)
at at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1575)
at at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:308)
at at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424)
at at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367)
at at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:964)
at at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
at at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
at at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
at at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)
at at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
at at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at at org.apache.catalina.startup.Catalina.start(Catalina.java:671)
at at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at at java.lang.reflect.Method.invoke(Method.java:497)
at at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:353)
at at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:493)
Caused by: ch.qos.logback.core.util.IncompatibleClassException
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:58)
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassName(OptionHelper.java:45)
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassName(OptionHelper.java:34)
at at ch.qos.logback.core.joran.action.AppenderAction.begin(AppenderAction.java:52)
at ... 58 common frames omitted
We have the suspect that the library that are colliding are:
bash-4.2$ grep -l AppenderAction.class /opt/apache-tomcat-9.0.2/lib/*.jar
/opt/apache-tomcat-9.0.2/lib/logback-core-1.2.3.jar
bash-4.2$ grep -l AppenderAction.class /opt/apache-tomcat-9.0.2/bin/*.jar
/opt/apache-tomcat-9.0.2/bin/tomcat-juli.jar
So logback-core-1.2.3.jar and tomcat-juli.jar containing both AppenderAction.class
Due to changes in various tomcat versions it is getting more complicated to house everything as a single build file and trying to profile it. As such, switching to a multimodule build will allow a single build to build all deliverables at once. This will improve the release process as well.
Is it possible to turn on the automatic configuration reloading? I tried to specify the 'scan="true"' attribute in logback.xml, but that's not worked for me
According to http://blog.spiderlabs.com/2014/02/cve-2014-0050-exploit-with-boundaries-loops-without-boundaries.html the tomcat 7 (prior to 7.0.51) and 8 are affected.
Could we change the version to the 7.0.52 (since 7.0.51 was not approved to release - http://tomcat.apache.org/security-7.html#Fixed_in_Apache_Tomcat_7.0.52)?
Thanks in advance.
The official tomcat-juli.jar has been modified, but this repository some classes are missing. See below:
Handler error
java.lang.ClassNotFoundException: org.apache.juli.AsyncFileHandler
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:581)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:524)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:322)
Can this project's resulting jars be put in maven central?
21:25:22,227 |-INFO in ch.qos.logback.access.tomcat.LogbackValve[null] - filename property not set. Assuming [conf/logback-access.xml]
21:25:22,228 |-INFO in ch.qos.logback.access.tomcat.LogbackValve[null] - Found configuration file [/pub/site/app/conf/logback-access.xml] using property "catalina.base"
21:25:22,255 |-INFO in ch.qos.logback.access.joran.action.ConfigurationAction - debug attribute not set
21:25:22,261 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
21:25:22,264 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [CONSOLE]
21:25:22,288 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
21:25:22,289 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [ACCESS-LOG]
21:25:22,303 |-INFO in c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy@1427646530 - Archive files will be limited to [20 MB] each.
21:25:22,306 |-INFO in c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy@1427646530 - Will use zip compression
21:25:22,308 |-INFO in c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy@1427646530 - Will use the pattern /pub/site/app/logs/archive/localhost-access-%d{yyyyMMdd}-%i.log for the active file
21:25:22,310 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@3270d194 - The date pattern is 'yyyyMMdd' from file name pattern '/pub/site/app/logs/archive/localhost-access-%d{yyyyMMdd}-%i.log.zip'.
21:25:22,310 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@3270d194 - Roll-over at midnight.
21:25:22,314 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@3270d194 - Setting initial period to Thu Mar 16 21:25:22 NOVT 2017
21:25:22,314 |-WARN in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@3270d194 - SizeAndTimeBasedFNATP is deprecated. Use SizeAndTimeBasedRollingPolicy instead
21:25:22,316 |-INFO in c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy@1427646530 - Cleaning on start up
21:25:22,316 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@25:25 - RuntimeException in Action for tag [rollingPolicy] java.lang.UnsupportedOperationException
at java.lang.UnsupportedOperationException
at at ch.qos.logback.access.tomcat.LogbackValve.getScheduledExecutorService(LogbackValve.java:452)
at at ch.qos.logback.core.rolling.helper.TimeBasedArchiveRemover.cleanAsynchronously(TimeBasedArchiveRemover.java:226)
at at ch.qos.logback.core.rolling.TimeBasedRollingPolicy.start(TimeBasedRollingPolicy.java:112)
at at ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy.start(SizeAndTimeBasedRollingPolicy.java:30)
at at ch.qos.logback.core.joran.action.NestedComplexPropertyIA.end(NestedComplexPropertyIA.java:161)
at at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:309)
at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:193)
at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:179)
at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:158)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:145)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:103)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:53)
at at ch.qos.logback.access.tomcat.LogbackValve.configureAsResource(LogbackValve.java:219)
at at ch.qos.logback.access.tomcat.LogbackValve.startInternal(LogbackValve.java:149)
at at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at at org.apache.catalina.core.StandardPipeline.startInternal(StandardPipeline.java:170)
at at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:953)
at at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793)
at at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at at org.apache.catalina.startup.Catalina.start(Catalina.java:655)
at at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
21:25:22,316 |-WARN in ch.qos.logback.core.rolling.RollingFileAppender[ACCESS-LOG] - No TriggeringPolicy was set for the RollingFileAppender named ACCESS-LOG
21:25:22,316 |-WARN in ch.qos.logback.core.rolling.RollingFileAppender[ACCESS-LOG] - For more information, please visit http://logback.qos.ch/codes.html#rfa_no_tp
21:25:22,316 |-WARN in ch.qos.logback.core.joran.action.AppenderAction - The object at the of the stack is not the appender named [ACCESS-LOG] pushed earlier.
21:25:22,316 |-ERROR in ch.qos.logback.core.joran.action.AppenderRefAction - Could not find an AppenderAttachable at the top of execution stack. Near [appender-ref] line 28
21:25:22,316 |-INFO in ch.qos.logback.access.joran.action.ConfigurationAction - End of configuration.
21:25:22,318 |-INFO in ch.qos.logback.access.joran.JoranConfigurator@4218d6a3 - Registering current configuration as safe fallback point
21:25:22,318 |-INFO in ch.qos.logback.access.tomcat.LogbackValve[null] - Done configuring
Without cleanHistoryOnStart
property logging works fine
per #144, additonal item discovery
2017-02-26 22:35:16,811[ost-startStop-1] [ERROR] [o.a.c.startup.ContextConfig 1624] - Failed to detect ServletContainerInitializers for context with name [/docs]
java.io.IOException: java.lang.ClassNotFoundException: ch.qos.logback.classic.servlet.LogbackServletContainerInitializer
at org.apache.catalina.startup.WebappServiceLoader.loadServices(WebappServiceLoader.java:192)
at org.apache.catalina.startup.WebappServiceLoader.load(WebappServiceLoader.java:159)
at org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1622)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1135)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:775)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5087)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1107)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1841)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: ch.qos.logback.classic.servlet.LogbackServletContainerInitializer
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1285)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.catalina.startup.WebappServiceLoader.loadServices(WebappServiceLoader.java:188)
... 18 common frames omitted
Hello guys @hazendaz
First of all thanks for your job, as always amazing 👍
And now passing to the issue I have some doubts about the the Quick Start documentation
1.- bin/tomcat-juli.jar to $CATALINA_HOME/bin (replacing existing tomcat-juli.jar)
I downloaded the tomcat-slf4j-logback but there is not any tomcat-juli.jar inside. Maybe do you refer to the file which is available as an "extra" component for tomcat. According to this page in Using Log4j section?
2.- bin/setenv.sh or bin\setenv.bat to $CATALINA_HOME/bin
Well after looking for this file, it is not exactly in bin in fact it is src/assembly/bin/
I know I am exaggerating.
3.- I cannot see the file logback-core-1.2.1.jar and either the file logback-access-1.2.1.jar, where could I find them?
Thanks in advance guys for your help
Hi @grgrzybek ,
I'm having a hard time setting up tomcat 8.0.36 with logback. I've followed the procedure described in README.md but I'm not getting the desired results.
After starting tomcat with $CATALINA_HOME/bin/startup.sh the logging files configured in logback.xml appenders are not being created in $CATALINA_HOME/logs. Furthermore, a file named $CATALINA_HOME/logs/catalina.out is being created. Below the first 10 lines generated:
17:49:14.128 [main] DEBUG org.apache.catalina.startup.ClassLoaderFactory - Creating new class loader
17:49:14.130 [main] DEBUG org.apache.catalina.startup.ClassLoaderFactory - Including directory file:/home/andre/dev/tmp/apache-tomcat-8.0.36/lib/
17:49:14.131 [main] DEBUG org.apache.catalina.startup.ClassLoaderFactory - Including directory glob /home/andre/dev/tmp/apache-tomcat-8.0.36/lib
17:49:14.131 [main] DEBUG org.apache.catalina.startup.ClassLoaderFactory - Including glob jar file /home/andre/dev/tmp/apache-tomcat-8.0.36/lib/jasper.jar
17:49:14.131 [main] DEBUG org.apache.catalina.startup.ClassLoaderFactory - Including glob jar file /home/andre/dev/tmp/apache-tomcat-8.0.36/lib/catalina-storeconfig.jar
17:49:14.131 [main] DEBUG org.apache.catalina.startup.ClassLoaderFactory - Including glob jar file /home/andre/dev/tmp/apache-tomcat-8.0.36/lib/tomcat-i18n-ja.jar
17:49:14.131 [main] DEBUG org.apache.catalina.startup.ClassLoaderFactory - Including glob jar file /home/andre/dev/tmp/apache-tomcat-8.0.36/lib/tomcat-i18n-es.jar
17:49:14.131 [main] DEBUG org.apache.catalina.startup.ClassLoaderFactory - Including glob jar file /home/andre/dev/tmp/apache-tomcat-8.0.36/lib/tomcat-util.jar
17:49:14.132 [main] DEBUG org.apache.catalina.startup.ClassLoaderFactory - Including glob jar file /home/andre/dev/tmp/apache-tomcat-8.0.36/lib/tomcat-websocket.jar
17:49:14.132 [main] DEBUG org.apache.catalina.startup.ClassLoaderFactory - Including glob jar file /home/andre/dev/tmp/apache-tomcat-8.0.36/lib/catalina-ha.jar
The log content seems to be produced by logback, but obviously not honoring in any way logback.xml. Any suggestions?
I'm using Maven 3.0.5 and I cannot build your latest source, I am seeing this issue:
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-enforcer-plugin:1.3.1, parent: sun.misc.Launcher$AppClassLoader@32edeea8]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce' with basic configurator -->
[DEBUG] (s) fail = true
[DEBUG] (s) failFast = false
[DEBUG] (f) ignoreCache = false
[DEBUG] (s) version = [3.1.1,)
[DEBUG] (s) rules = [org.apache.maven.plugins.enforcer.RequireMavenVersion@5d0e47b3]
[DEBUG] (s) skip = false
[DEBUG] (s) project = MavenProject: org.grgrzybek:tomcat-slf4j-logback:1.1.0 @ /home/mondain/workspace/github/tomcat-slf4j-logback/pom.xml
[DEBUG] (s) session = org.apache.maven.execution.MavenSession@28f9533
[DEBUG] -- end configuration --
[DEBUG] Executing rule: org.apache.maven.plugins.enforcer.RequireMavenVersion
[DEBUG] Rule org.apache.maven.plugins.enforcer.RequireMavenVersion is cacheable.
[DEBUG] Detected Maven Version: 3.0.5
[DEBUG] Adding failure due to exception
org.apache.maven.enforcer.rule.api.EnforcerRuleException: Detected Maven Version: 3.0.5 is not in the allowed range [3.1.1,).
at org.apache.maven.plugins.enforcer.AbstractVersionEnforcer.enforceVersion(AbstractVersionEnforcer.java:106)
at org.apache.maven.plugins.enforcer.RequireMavenVersion.execute(RequireMavenVersion.java:51)
at org.apache.maven.plugins.enforcer.EnforceMojo.execute(EnforceMojo.java:177)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireMavenVersion failed with message:
Detected Maven Version: 3.0.5 is not in the allowed range [3.1.1,).
Due to profiling and other underlying changes, we need to closely review this before we start getting updates out to sourceforge. We are a little behind and this is targetted for the moment at all things current. However, due to the large scale changes recently we just need to verify that everything works as we expected before pushing anything. I had noted this on a PR since closed so that lost visibility. This brings back the visibility. I think everything is ok but wanted a second set of eyes to verify we are good.
The advised setting of adding LOGGING_MANAGER=-Dnop
to setenv.sh, which causes the -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
parameter to be omitted from Tomcat's command line, will make java.util.logging's fall back to using java.util.logging.LogManager as its manager, which isn't webapp aware. This causes issues when each webapp tries to configure jul by itself (by adding handlers, for example).
I was attempting to use the jul-to-slf4j bridge to make jul logging go through SLF4J and then through Logback, in order to route jul logs that are emitted by libraries that I don't control (things like JAX-WS and Jersey) through Logback as well. Each webapp already configures its own Logback with their own parameters and logging files, which they already normally use through SLF4J, but also initialize the jul-to-slf4j bridge by registering SLF4JBridgeHandler with JUL's LogManager in a startup listener. None of these (logback-classic, sl4fj, jul-to-slf4j) are in the Tomcat classloader, they are being shipped in each webapp's WEB-INF/lib specifically so I can use different logback.xml settings for each webapp.
Since the LogManager isn't ClassLoaderLogManager anymore, and java.util.logging.LogManager is in the system classloader, each jul-to-slf4j initialization overrides the previous webapp's handler. As an end result, every jul log goes through the SLF4JBridgeHandler class that is in the classloader of the last webapp that performed the initialization and therefore uses the Logback instance and configuration of the last application.
Removing LOGGING_MANAGER=-Dnop
makes Tomcat go back to using ClassLoaderLogManager as its jul manager and the jul-to-slf4j handlers don't override eachother. Each webapp then sees the SLF4JBridgeHandler from its own classloader and routes the log through its own instance of Logback properly.
Is there any reason why this setting is being recommended? It seems to me that keeping jul's logging manager set to org.apache.juli.ClassLoaderLogManager is highly beneficial to applications/libraries that use jul logging and it doesn't seem to impact anything else.
Hello!
I'm using single Tomcat installation for launching multiple Tomcat instances on the same server.
And I want to totally disable JULI so I extraced release archive in the $CATALINA_HOME and removed $CATALINA_HOME/conf/logging.properties.
I'm using setenv.sh to define CLASSPATH variable for some instances. And if there is local one $CATALINA_BASE/bin/setenv.sh, global one $CATALINA_HOME/bin/setenv.sh will not be included in the startup script:
if [ -r "$CATALINA_BASE/bin/setenv.sh" ]; then
. "$CATALINA_BASE/bin/setenv.sh"
elif [ -r "$CATALINA_HOME/bin/setenv.sh" ]; then
. "$CATALINA_HOME/bin/setenv.sh"
fi
My suggestion is to remove $CATALINA_HOME/bin/setenv.sh and add block in the $CATALINA_HOME/bin/catalina.sh startup script like this:
if [ -r "$CATALINA_BASE/conf/logback.xml" ]; then
JAVA_OPTS="-Djuli-logback.configurationFile=$CATALINA_BASE/conf/logback.xml $JAVA_OPTS"
elif [ -r "$CATALINA_HOME/conf/logback.xml" ]; then
JAVA_OPTS="-Djuli-logback.configurationFile=$CATALINA_HOME/conf/logback.xml $JAVA_OPTS"
fi
and place it before setenv.sh handling to keep ability to redefine juli-logback.configurationFile
in the $CATALINA_BASE/bin/setenv.sh
This will let us to use custom logback.xml located in the $CATALINA_BASE/conf or use default in the $CATALINA_HOME/conf
Hi,
Could someone tell me know how I can use the STMPAppender in combination with tomcat-slf4j-logback ? (I'm getting "java.lang.ClassNotFoundException: javax.mail.internet.AddressException").
Ideally, I would also like to use the STMPAppender in my deployed web applications as well.
(the idea being to send an email notification for any caught or uncaught appilcation errors)
Thank you very much in advance for your feedback.
Regards
kbjp
PS: if I simply add the mail jar to the CLASSPATH through setenv.bat, it kind of "works" but seem to be conflicting with the mail jar from my applications.
Old issue items probably don't need noted any longer as no one should really be using old builds as with anything tomcat, nearly all old tomcats are vulnerable.
Also there are notes referring to my personal repo location, those should be set to the project here. Data is the same but points it to the group location instead of my personal.
Hello,
First of all I found jms-1.1.jar in JBoss maven repository http://repository.jboss.org/maven2/javax/jms/jms/1.1/.
I've just tried it with tomcat 7.0.6 and it works like a charm. However when I try to stop tomcat I get this NoClassDefFoundError:
00:04:51.518 [Thread-3] INFO org.apache.coyote.ajp.AjpProtocol - Stopping ProtocolHandler ["ajp-bio-8009"]
00:04:51.519 [Thread-3] DEBUG o.apache.tomcat.util.net.JIoEndpoint - About to unlock socket for:localhost/127.0.0.1:8009
00:04:51.519 [Thread-3] DEBUG o.apache.tomcat.util.net.JIoEndpoint - Socket unlock completed for:localhost/127.0.0.1:8009
00:04:51.519 [Thread-3] DEBUG o.apache.catalina.util.LifecycleBase - Setting state for [org.apache.catalina.connector.MapperListener@418bbf55] to [STOPPING_PREP]
00:04:51.519 [Thread-3] DEBUG o.apache.catalina.util.LifecycleBase - Setting state for [org.apache.catalina.connector.MapperListener@418bbf55] to [STOPPING]
00:04:51.520 [Thread-3] DEBUG o.apache.catalina.util.LifecycleBase - Setting state for [org.apache.catalina.connector.MapperListener@418bbf55] to [STOPPED]
00:04:51.520 [Thread-3] DEBUG o.apache.catalina.util.LifecycleBase - Setting state for [Connector[AJP/1.3-8009]] to [STOPPED]
00:04:51.520 [Thread-3] DEBUG o.apache.catalina.util.LifecycleBase - Setting state for [StandardService[Catalina]] to [STOPPED]
00:04:51.520 [Thread-3] DEBUG o.apache.catalina.util.LifecycleBase - Setting state for [StandardServer[8005]] to [STOPPED]
Exception in thread "Thread-3" java.lang.NoClassDefFoundError: org/apache/juli/ClassLoaderLogManager
at org.apache.catalina.startup.Catalina$CatalinaShutdownHook.run(Catalina.java:828)
Caused by: java.lang.ClassNotFoundException: org.apache.juli.ClassLoaderLogManager
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 1 more
Jasper listener was removed. Apply that on newer versions. Since this will result in most configuration going locally similar to tomcat6, this makes for a good point to confirm no other gotcha's haven't otherwise been addressed.
Hi,
I tried to use tomcat85-slf4j-logback:8.5.15
but it cannot be found on maven central (only 8.5.14
). If I downgrade to 8.5.14
, the parent tomcat-slf4j-logback:1.0.5
cannot be found (only 1.0.4
). Could you please fix that? Is there an alternative repository to be used?
Hi,
I'm trying to use Lilith (http://lilith.huxhorn.de/) to receive Tomcat logging events. I've configured the access log and the standard log to use Logback's SocketAppender. This works fine with the Access Log but fails with the standard because the log event is serialised with the shaded class name, not with the original class name.
Error message in Lilith is:
Exception (java.lang.ClassNotFoundException: 'org.apache.juli.logging.ch.qos.logback.classic.spi.LoggingEventVO') while reading events. Adding eventWrapper with empty event and stopping...
Is there any possible way of serialising the event with the original class name instead of the shaded name?
Alternatively, Lilith provides JSON and XML appenders that could be used instead but they have a lot of dependencies that would probably need shading as well. - A potential solution but not ideal.
Any other ideas?
Thanks
Hello!
Could you please build new releases for recent versions of Tomcat?
7.0.76
8.0.42
8.5.12
9.0.0M19
Has anyone had any success getting this to work using one of Bitnami's tomcat stack images?
I tried unzipping the contents as instructed and I can see that the logging has changed, however, it looks like it's ignoring the logback.xml file and dumping everything out at debug.
Thanks in advance for any insight on this!
Sean
I'm trying to send our access logs to a Graylog instance with the following configuration:
...
<appender name="GELF" class="biz.paluch.logging.gelf.logback.GelfLogbackAppender">
<host>udp:graylog.dev.company.com</host>
<version>1.1</version>
<extractStackTrace>true</extractStackTrace>
<additionalFields>
service=application-tomcat-access,version=3.40.5,organization=test,cluster=test
</additionalFields>
</appender>
<appender name="ASYNC_GELF" class="ch.qos.logback.classic.AsyncAppender">
<neverBlock>true</neverBlock>
<queueSize>512</queueSize>
<appender-ref ref="GELF" />
</appender>
<appender-ref ref="ACCESS-LOG" />
<appender-ref ref="ASYNC_GELF" />
However the <appender-ref ref="ASYNC_GELF" />
seems to be completely ignored for access-logging but works for the application hosted by Tomcat. What am I missing?
On a related note I can't find any documentation for logback where the <appender-ref>
tag is used/allowed directly under the <configuration>
tag. Is this using some custom solution?
I have this warning after applying resources from tomcat-juli-8.5.11-slf4j-1.7.22-logback-1.1.8.zip to pure tomcat 8.5
21:16:53,452 |-INFO in org.apache.juli.logging.ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@7006c658 - The date pattern is 'yyyyMMdd' from file name pattern '/Users/sj/Downloads/tomcat85/apache-tomcat-8.5.11/logs/archive/catalina-%d{yyyyMMdd}-%i.log.zip'.
21:16:53,452 |-INFO in org.apache.juli.logging.ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@7006c658 - Roll-over at midnight.
21:16:53,457 |-INFO in org.apache.juli.logging.ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@7006c658 - Setting initial period to Sun Feb 26 21:16:53 EET 2017
21:16:53,458 |-WARN in org.apache.juli.logging.ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@7006c658 - SizeAndTimeBasedFNATP is deprecated. Use SizeAndTimeBasedRollingPolicy instead
Would it kindly be possible to build a new release for recent Tomcat version 8.5.20?
Thanks in advance.
John
This is not directly related to this project but I figure this is a good place to possibly get some insight :)
We have some webapps that, when deployed in a Tomcat instance that uses Logback for logging (using this project's excellent efforts), fail with exceptions like this:
org.apache.commons.discovery.DiscoveryException:
Class org.apache.juli.logging.impl.SLF4JLogFactory does not implement \
org.apache.commons.logging.LogFactory
We have to set this Java property for these webapps to work again:
-Dorg.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl
These webapps usually use Log4j (e.g. log4j-1.2.17.jar) and SLF4j (e.g. slf4j-api-1.7.5.jar and sometimes slf4j-log4j12-1.7.5.jar) internally for logging, but are not really similar in any special way. Some include commons-logging-1.1.jar or commons-logging-1.0.4.jar and others include nothing related to commons-logging.
Do you have an idea what these webapps are doing wrong (if anything) or what they are missing in order to work correctly with a Tomcat instance that uses Logback internally? Or is setting the above property really the solution?
due to #125 which allowed release of bundles to maven central it broke all future builds from including in the zip file tomcat-juli as our version. This is a result of the assembly running before the shade plugin. To fix this the order needs changed in all modules. We won't be able to address the issue in central but ongoing these should be right and fall back is github releases which happened to have occurred before this issue was introduced.
Given the recent issues surrounding Sourceforge and their behaviour towards hosted projects, like bundling adware/crapware/malware with installers, hijacking accounts of inactive projects, etc, you might want to consider hosting your downloads somewhere else. Blockers like uBlock Origin have already blacklisted Sourceforge because of this.
Notepad++ has summarised the situation succinctly: https://notepad-plus-plus.org/news/notepad-plus-plus-leaves-sf.html
Here is a page that also summarises what happened and which alternatives to Sourceforge are available: http://helb.github.io/goodbye-sourceforge/
It is probably easiest to host the binary downloads directly on Github.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.