Platform Framework
R24 AMR | Min(s) read

Logging COMO

When you use LOG4J2 as the logging API, it is possible to redirect COMOs to a standard logger.

Defining a Routing and a File Appender

By default, a routing appender is defined to have each agent logging to its own COMO file (standard file appender). The routing is defined by a thread context property matching the COMO name.

Set the following property as system property or JVM property at application start up:

- temenos.log.como=true

The above configuration generates the COMO logger and appender configuration within the TAFJTrace.properties file. When you use an existing deployment, make sure to delete the current TAFJTrace configuration file. The COMO appender and logger will be defined in the newly generated configuration file, i.e. when you use the properties configuration format.

appender.como.type = Routing

appender.como.name = como

appender.como.routes.type = Routes

appender.como.routes.pattern = $${ctx:COMO-NAME}

appender.como.routes.route1.type = Route

appender.como.routes.route1.file.type = File

appender.como.routes.route1.file.name = como-${ctx:COMO-NAME}

appender.como.routes.route1.file.fileName = ${sys:temenos.log.directory.como}/${ctx:COMO-NAME}

appender.como.routes.route1.file.layout.type = PatternLayout

appender.como.routes.route1.file.layout.pattern = %m%n

By default, COMOs log files are generated under <TAFJ_HOME>/log_T24/como. You can override this behavior by using the following property:

- temenos.log.directory.como=<PATH_TO_YOUR_COMO_LOG_FOLDER>

You must set the above properties at TAFJ start up by using the environment variables or JVM arguments.

Combining a Socket, Routing and a File Appender

You can use the routing appender specified in the above section in conjunction with a socket appender to generate COMO files on a remote logging server. In this scenario, TAFJ application acts as a client of the logging server.

When you use the properties configuration format, make the following configurations to use the appender on the TAFJTrace configuration file:

#Socket client appender to be used to redirect como files to above remote routing appender

#Setup appropriate hostname and port to match the remote logging server

appender.como.type = Socket

appender.como.name = como

appender.como.host = 10.56.7.99

appender.como.port = 1212

appender.como.layout.type = SerializedLayout

appender.como.connectTimeoutMillis = 2000

appender.como.reconnectionDelayMillis = 10000

appender.como.protocol = TCP

Copyright © 2020- Temenos Headquarters SA

Published on :
Monday, May 27, 2024 5:03:18 PM IST