Skip to main content

         This documentation site is for previous versions. Visit our new documentation site for current releases.      

This content has been archived and is no longer being updated.

Links may not function; however, this content may be relevant to outdated versions of the product.

Use a LOG4J appender to produce multiple smaller log files

Updated on August 28, 2019


Our log file has messages from a lot of different applications.   This makes navigating the log difficult.  Is there a way we could have a log file per application? 

Is it a good practice for each application to write to a separate log file?  If so, what steps do I need to take to accomplish this?



Suggested Approach

Yes, you can split the logfile per application. There is something in log4j called an appender, which is basically the mechanism by which log4j writes to the individual logfiles. You can use it to split the logfiles being written to by class, e.g. com.pega.pegarules.engine.database etc.

If you want to get fancier than that, you could do things within your own appender, for example such that a piece of data within the message could cause the switch in logfile.   You have, therefore, all the facilities of log4j at your disposal for accomplishing the kind of logfile split you're talking about.   Process Commander has adapted the standard log4j facilities, but most of log4j capability is available to you.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best. is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us