Routing specific log categories to a new file

  • 7006040
  • 19-May-2010
  • 11-Jul-2012

Environment


Business Service Manager 4.5

Situation

You want to write a specific logging category that appears in the formula.trc to new file.

For instance, when a BSCM job runs, you want the logging to appear in a file called bscm.trc.

Resolution

1. If the file ../config/formula.custom.properties, does not exist, create it.
2. Copy the next section from this TID into formula.custom.properties.

log4j.appender.A9=com.mosol.util.LogInfoAppender
log4j.appender.A9.LogInfo=FILE "<copy this section from formula.properites>bscm.trc" SIZE 5000000 RENAME "<copy this section from formula.properites>bscm.$datetime.trc"
log4j.appender.A9.layout=org.apache.log4j.TTCCLayout
log4j.appender.A9.layout.ThreadPrinting=false
log4j.appender.A9.layout.ContextPrinting=true
log4j.appender.A9.layout.CategoryPrefixing=true
log4j.appender.A9.layout.DateFormat=ISO8601

log4j.category.Server.BSCM=INFO,A9
log4j.additivity.Server.BSCM=false

3. Note, in the example configuration that appender is called, A9. This can be changed to another name.
4. Note, that the category to be routed to bscm.trc is, Server.BSCM.
5. Note, the line, log4j.category.Server.BSCM=INFO,A9. If you changed the appender name, you must change the name on this line.
5. Copy the correct directory path from the similar section in formula.properties, specific to you BSM installation, over the section in the example, <copy this section from formula.properites>. Please, include all forward or backward slashes.
6. If you want to change the logging category written to bscm.trc, you must change both line that refer to, Server.BSCM.
7. Restart BSM
8. Note, bscm.trc should have appeared in your logs directory.

Do not make these changes in the formula.properties files, that file is overwritten every time the Customizer runs. If you must change the file, change the template version in ../config/template/formula.properties and run the Customizer. This is not recommended!