1

I use logback-access instead of tomcat default valve.

I used %b pattern, but output is so weird.

First, i use class "ch.qos.logback.access.tomcat.LogbackValve"

I wrote this pattern.

[%t]\t%U\t%s\t%D\t%b

Second, i use class "org.apache.catalina.valves.AccessLogValve"

I wrote this pattern.

pattern="%t	%U	%s	%D	%b

I think they are same, and try use same time. But "%b" attribute output is different.

This is example.

First, Logback.

[02/Jun/2015:20:12:28 +0900] /test/testLayout.css 200 366 -

Second, Tomcat valve.

[02/Jun/2015:20:12:28 +0900] /test/testLayout.css 200 367 2769

Logback's output is "-" but Tomcat is "2769"

I think Tomcat valve's value is correct.

Why they are different?

Please tell your advice.

ps. Logback version is 1.1.3. I use logback-core-1.1.3.jar, logback-classic-1.1.3.jar. When use logback-access-1.1.3 at the same time, tomcat puts error.

Aristein
  • 41
  • 4

0 Answers0