Netweaver
tcode SAAB,将Logpoints设置为"Log":
给想打开trace的user创建一个activation:
新建一个report:
执行完report后返回SAAB即可查看到记录的log.
CloudFoundry
pom.xml里定义cf-logging, log4j2和slf4j这三个组件的版本号:
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-logging-support-log4j2</artifactId>
<version>${cf-logging-version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-logging-support-servlet</artifactId>
<version>${cf-logging-version}</version>
</dependency>
代码里的使用:
log记录成功:
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
网友评论