Logging different files with log4j


EJB programming & troubleshooting: Logging different files with log4j

  1. Logging different files with log4j (2 messages)

    Hi, I am working on an ejb application which has a single jboss with many clients. All the log goes to the server.log but my target is to get different logs for different clients. Example:- 1) If a person starts the application and the application shows him different domains that he can log in to. Let the list of domains be {D1,D2,D3,D4,D5}. He logs into D1, then jboss should specifically send all the logs of that domain to a single file named as D1dd-mm-yyyy. 2) If another person at the same time logs into domain D2, then his server side logs should go to D2dd-mm-yyyy irrespective of the logs of the other domain. So my task is to separate logs based on the domains. Thanks in advance. Vivek
  2. Re: Logging different files with log4j[ Go to top ]

    In log4j.properties file you can use different log4j file appenders to specify different log files like log4j.appender.Login.File=logs.dir/log4j.appender.Login.File log4j.appender.Workflow.File=logs.dir/workflow.log
  3. So my task is to separate logs based on the domains.
    We are using logFaces server to address particularly this issue. You can give names to your applications and then get focused on them either in real-time or querying the historical data. You can also use MDC for doing this..