Skip to content

Latest commit

 

History

History
20 lines (17 loc) · 743 Bytes

Application-toolkit-log4j-1.x.md

File metadata and controls

20 lines (17 loc) · 743 Bytes
  • Dependency the toolkit, such as using maven or gradle
   <dependency>
      <groupId>org.apache.skywalking</groupId>
      <artifactId>apm-toolkit-log4j-1.x</artifactId>
      <version>{project.release.version}</version>
   </dependency>
  • Config a layout
log4j.appender.CONSOLE.layout=TraceIdPatternLayout
  • set %T in layout.ConversionPattern ( In 2.0-2016, you should use %x, Why change? )
log4j.appender.CONSOLE.layout.ConversionPattern=%d [%T] %-5p %c{1}:%L - %m%n
  • When you use -javaagent to active the sky-waking tracer, log4j will output traceId, if it existed. If the tracer is inactive, the output will be TID: N/A.