开发者

Configuring log4j for a specific user

开发者 https://www.devze.com 2023-02-25 07:38 出处:网络
Hi I am using log4j in my J2EE application, I have a scenario of enabling logging details of a particular user and write his log details inseparate file.

Hi I am using log4j in my J2EE application, I have a scenario of enabling logging details of a particular user and write his log details in separate file.

Is there any way to implement this.

any help will be appreciated
开发者_运维问答


There are ways, but you can't do it by configuration.

You need to write your own appender extending an existing Appender class (for example FileAppender or RollingFileAppender) and to override at least "public void activateOptions()" to set the file according to the current user.

0

精彩评论

暂无评论...
验证码 换一张
取 消