TAFJ Logging
TAFJ Logging
TAFJ Logging
R20
TAFJ-Lo g gi n g
Amendment History:
Revisio
Date Amended Name Description
n
1 30th March 2019 TAFJ team Initial version
2 25th March 2020 S. Sakthi R20 AMR Review
Page 2
TAFJ-Lo g gi n g
Table of Contents
Copyright................................................................................................................................................ 4
Errata and Comments............................................................................................................................ 4
Logger.................................................................................................................................................... 5
Log api customization............................................................................................................ 5
Default configuration.......................................................................................................... 5
Switching log API............................................................................................................... 7
Backward compatibility, keep using log4j 1.2 natively....................................................... 8
Log folders customization.................................................................................................... 10
Logging COMO................................................................................................................... 11
Routing and file appender................................................................................................ 11
Socket appender and routing and file appender.............................................................. 12
Logger context..................................................................................................................... 14
Log redirect for Splunk........................................................................................................ 15
Multi-Tenant Logging............................................................................................................................ 16
Details of Log Types in TAFJTrace...................................................................................................... 17
Page 3
TAFJ-Lo g gi n g
Copyri g h t
Copyright © Temenos Headquarters SA 2009-2020. All rights reserved.
This document contains proprietary information that is protected by copyright. No part of this document may
be reproduced, transmitted, or made available directly or indirectly to a third party without the express
written agreement of TEMENOS UK Limited. Receipt of this material directly TEMENOS UK Limited
constitutes its express permission to copy. Permission to use or copy this document expressly excludes
modifying it for any purpose, or using it to create a derivative therefrom.
Temenos Headquarters SA
2 Rue de l’Ecole-de-Chimie,
CH - 1205 Geneva,
Switzerland
Please include your name, company, address, and telephone and fax numbers, and email
address if applicable. TAFJdev@temenos.com
Page 4
TAFJ-Lo g gi n g
Log g e r
T24 execution and TAFJ internal behavior could be monitored with logs.
Standard logging APIs (SLF4J, Log4J 1.2, Log4J 2.x) are used and a default logger
configuration, writing to files is provided within:
<TAFJ_HOME>\conf\TAFJTrace.properties.
This configuration could be either a Log4J 1.2 or Log4J2 configuration, depending either on
your TAFJ version or on the runtime configuration.
This file is generated automatically in the appropriate Log4j 1.2 or Log4j 2 format if it’s not
already existing.
For more information please refer to the appropriate logging API documentation, links are
provided in the related section.
By default, several different loggers are defined, providing information related to a specific
topic: T24, Database, Runtime, MDB, EJB, etc…
Log api cu s t o m i z a t i o n
Defa u l t con fi g u r a t i o n
The default runtime configuration is making use natively either of Log4j 1.2 or Log4j 2.
Since PB201607 (June 2016 release), historical Log4j 1.2 configuration is switched to Log4j
2.
When upgrading from an existing installation to PB201607 and higher, any older existing
TAFJTrace.properties will be overridden to fit Log4j 2 format.
For backward compatibility this is still possible to use Log4j 1.2, but not recommended as
further logging enhancements are not going to be supported with this log4j version.
Page 5
TAFJ-Lo g gi n g
Log4j configuration
File TAFJTrace.properties for more information see
https://logging.apache.org/log4j/1.2/manual.html
log4j.debug=false
log4j.rootLogger=OFF
log4j.logger.T24=INFO, t24
log4j.logger.BASIC=ERROR, basic
log4j.logger.PRINTER=ERROR, printer
log4j.logger.DATABASE=ERROR, database
log4j.logger.JQL=ERROR, jql
log4j.logger.LOCKING=INFO, locking
log4j.logger.COMPILER=WARN, compiler
log4j.logger.DEPENDENCY=INFO, dependency
log4j.logger.RUNTIME=ERROR, runtime
log4j.logger.DBIMPORT=ERROR, dbimport
log4j.logger.SQLTRACE=ERROR, sqltrace
log4j.logger.ITYPE=ERROR, itype
log4j.logger.EXECUTE=ERROR, execute
log4j.logger.IOSERVER=INFO, ioserver
log4j.logger.MDB=ERROR, mdb
log4j.logger.EJB=ERROR, ejb
log4j.logger.MONITOR=ERROR, monitor
log4j.logger.API=INFO, api
…
Log4j2 configuration
File TAFJTrace.properties for more information see http://logging.apache.org/log4j/2.x/
Page 6
TAFJ-Lo g gi n g
loggers =
API,BASIC,CACHE,COHERENCE,COMPILER,COMPONENT_BUILDER,COMPONENT_USAGE,DATABASE
,DATABASE_RO,DBIMPORT,DBIMPORT_COMPARER,DEPENDENCY,DBTOOLS,EJB,EXECUTE,FILTER
,ITYPE,JQL,JQL_NOTSUPPORTED,LOCKING,MDB,PRINTER,RUNTIME,SANITYCHECK,SQLTRACE,
T24,TRUN,UPDATER,WRITEOUTOFTRANS,
logger.API.name = API
logger.API.level = ERROR
logger.API.additivity = false
logger.API.appenderRefs = api
logger.API.appenderRef.api.ref = api
logger.BASIC.name = BASIC
logger.BASIC.level = ERROR
logger.BASIC.additivity = false
logger.BASIC.appenderRefs = basic
logger.BASIC.appenderRef.basic.ref = basic
logger.CACHE.name = CACHE
logger.CACHE.level = ERROR
logger.CACHE.additivity = false
logger.CACHE.appenderRefs = cache
logger.CACHE.appenderRef.cache.ref = cache
…
As stated above TAFJ is currently supporting Log4j and Log4j2, hence switching to SLF4J
would make sense in case of wanting to use Log4j as a backend API to continue using any
pre-PB201607 configuration.
Classpath setup
To be able to use SLF4J and Log4j 1.2, some classpath modification needs to be done.
o <TAFJ_HOME>\3rdParty\logging\slf4j\slf4j-api.jar
o <TAFJ_HOME>\3rdParty\logging\slf4j\slf4j.log4j12.jar
o <TAFJ_HOME>\3rdParty\logging\log4j12\log4j.jar
Page 7
TAFJ-Lo g gi n g
Runtime setup
To switch from native Log4j2 API to SLF4J, simply set the following system property.
-Dtemenos.log.api=SLF4J
- Linux :
- Windows
o set temenos.log.api=SLF4J
To switch the backend API (behind SLF4J), to be Log4j 1.2 simply set the following system
property.
-Dtemenos.log.backend=LOG4J
- Linux :
- Windows
o set temenos.log.backend=LOG4J
It has to be set at TAFJ start up, and should be done through environment variables or
JVM arguments
Page 8
TAFJ-Lo g gi n g
Classpath setup
To be able to use Log4j 1.2, some classpath modification needs to be done.
o <TAFJ_HOME>\3rdParty\logging\log4j12\log4j.jar
Runtime setup
To switch from native Log4j2 API to Log4j 1.2, simply set the following system property.
-Dtemenos.log.api=LOG4J
- Linux :
- Windows
Page 9
TAFJ-Lo g gi n g
Log fold e r s cu s t o m i z a t i o n
By default you will find above mentioned logs under following folders:
- temenos.log.directory=<PATH_TO_YOUR_TAFJ_LOG_FOLDER>
- temenos.log.directory.t24=<PATH_TO_YOUR_T24_LOG_FOLDER>
It has to be set at TAFJ start up, and should be done through environment variables or
JVM arguments.
You cannot use the tafj.properties file for that purpose as loggers get initialized before tafj
properties get loaded.
-Dtemenos.log.directory=/path/to/your/custom/log/folder
- Linux :
o export temenos_log_directory=’path/to/your/custom/log/directory’
- Windows
o set temenos.log.directory=path\to\your\custom\log\directory
To revert this setting in tafj shell, simply set the property to an empty value.
- Linux :
o export temenos_log_directory=
- Windows
o set temenos.log.directory=
Page 10
TAFJ-Lo g gi n g
Log g i n g COMO
When using LOG4J2 as the logging API, it is possible to redirect COMOs to a standard
logger.
Simply set the following property as system property or JVM property at application start up.
- temenos.log.como=true
It will generate the “como” logger and appender configuration within TAFJTrace
configuration.
When using an existing deployment, make sure to delete current TAFJTrace configuration
file.
The como appender and logger will be defined in the newly generated configuration file.
<TAFJ_HOME>/log_T24/como
- temenos.log.directory.como=<PATH_TO_YOUR_COMO_LOG_FOLDER>
Above properties have to be set at TAFJ start up, and should be done through
environment variables or JVM arguments.
Page 11
TAFJ-Lo g gi n g
In this scenario, TAFJ application will become a client of the logging server.
The appender to use on TAFJTrace configuration side will be the following, i.e. when using
properties configuration format.
#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
On the server side, the same routing appender than defined above will be used to receive
the log events from the socket and route them to the appropriate file.
1- Deploy on the logging server (LOG4J_HOME below) the following libraries which can
be found in the TAFJ release under 3rdParty\logging\log4j2:
o log4j-core.jar
o log4j-api.jar
o jcommander-1.48.jar
2- Copy on the server the TAFJTrace configuration defining the como routing appender
3- Start the TCP socket server with appropriate classpath and parameters, i.e.
set LOG4J_HOME=C:\lo4j-socket-server-conf
set CLASSPATH=%LOG4J_HOME%\*
set JAVA_OPTS=-Dtemenos.log.directory=%LOG4J_HOME%\log
-Dtemenos.log.directory.t24=%LOG4J_HOME%\t24-log -Dtemenos.log.directory.como=
%LOG4J_HOME%\como-log
Page 12
TAFJ-Lo g gi n g
The TCP socket server will be started on the specified option -p port 1212 and defining the
logger configuration coming from option -c TAFJTrace.xml.
In this case the client appender configuration has to be refined to define SSL parameters.
i.e.
appender.como.ssl.type = SSL
appender.como.ssl.protocol = SSL
appender.como.ssl.keystore.type=KeyStore
appender.como.ssl.keystore.location=log4j2-keystore.jks
appender.como.ssl.keystore.password=changeme
appender.como.ssl.truststore.type=TrustStore
appender.como.ssl.truststore.location=trustore.jks
appender.como.ssl.truststore.password=changeme
Page 13
TAFJ-Lo g gi n g
Log g e r co n t e x t
In a multi-tenant environment you may want to define a specific logger context to differentiate
the logs from the different tenants. It could also be useful for debugging purpose where a
user can define its own context.
By using property
- temenos.log.context=<YOUR_CONTEXT_NAME>
When using a context you will also generate a dedicated file to configure your
appenders: TAFJTrace.<YOUR_CONTEXT_NAME>.properties file.
Like log directories properties it has to be set at TAFJ start up, and should be done through
environment variables or JVM arguments, refer to log folder customization sample above.
-Dtemenos.log.context=customLogContext
- Linux :
o export temenos_log_context=customLogContext
- Windows
o set temenos.log.context=customLogContext
To revert this setting in tafj shell, simply set the property to an empty value.
- Linux :
o export temenos_log_context=
- Windows
o set temenos.log.context=
Page 14
TAFJ-Lo g gi n g
To redirect logs into Splunk instance, we need to modify the following property in
tafj.properties file
o temn.tafj.runtime.redirection.logger=
By default, if the above mentioned property is empty, logs will be generated in filexplorer.
If the splunk component is provided as the value for the above mentioned property, logs will
get forwarded to splunk.
ie) temn.tafj.runtime.redirection.logger=splunk
Specify the splunk URL and token using the below mentioned two properties,
o temn.tafj.runtime.redirection.splunk.url=
o temn.tafj.runtime.redirection.splunk.token=
By default, if the above mentioned properties are not provided, the default URL and token
used.
Token = 0fbb0a31-4548-4468-a49b-64c361be3376
tCreateTraceWriter
Once the above properties are defined in tafj.properties file, user has to execute
tCreateTraceWriter file which is located inside %TAFJ_HOME%\bin directory in order to
generate the new TAFJTrace.properties file which is compatible for Splunk component.
appender.T24.name = T24
appender.T24.url = ${defaultUrl}
Page 15
TAFJ-Lo g gi n g
appender.T24.token = ${defaultToken}
appender.T24.layout.type = PatternLayout
appender.T24.layout.pattern = ${defaultPattern}
appender.api.type = Routing
appender.api.name = api
appender.api.routes.type = Routes
appender.api.routes.pattern = $${ctx:tenantId}
appender.api.routes.route1.type = Route
appender.api.routes.route1.file.type = RollingFile
appender.api.routes.route1.file.name = api
appender.api.routes.route1.file.fileName = ${defaultLogDirectory}/${ctx:tenantId:-}/api.log
appender.api.routes.route1.file.filePattern = ${defaultLogDirectory}/${ctx:tenantId:-}/api.log.
%i.gz
appender.api.routes.route1.file.layout.type = PatternLayout
appender.api.routes.route1.file.layout.pattern = ${defaultPattern}
appender.api.routes.route1.file.policies.type = Policies
appender.api.routes.route1.file.policies.size.type = SizeBasedTriggeringPolicy
appender.api.routes.route1.file.policies.size.size=${defaultMaxFileSize}
appender.api.routes.route1.file.strategy.type = DefaultRolloverStrategy
appender.api.routes.route1.file.strategy.min = ${defaultMinBackupIndex}
appender.api.routes.route1.file.strategy.max = ${defaultMaxBackupIndex}
Page 16
TAFJ-Lo g gi n g
When a tenantId is active, it will be routed to the tenantId directory under defaultLogDirectory
(generally $TAFJ_HOME/log). For example, if TenantId1 is active, logs for TenantId1 will
appear under $TAFJ_HOME/log/TenantId1 directory. If no tenant is active, then logs appear
normally in the defaultLogDirectory. Likewise, COMO logs to the directory defined by
temenos.log.directory.como (generally $TAFJ_HOME/log_T24/como if no tenant is active). If
Tenant1 is active, it would log to $TAFJ_HOME/log_T24/como/Tenant1.
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:tenantId:-}/${ctx:COMO-NAME}
appender.como.routes.route1.file.layout.type = PatternLayout
appender.como.routes.route1.file.layout.pattern = %m%n
The log types used by the TAFJ component are listed in the following table,
Log Types
Page 17
TAFJ-Lo g gi n g
Page 18
TAFJ-Lo g gi n g
Page 19
TAFJ-Lo g gi n g
34 T24 Logs will get written while working with T24 product.
37 WRITEOUTOFTRANS Logs all database writes information which are not part of
Page 20
TAFJ-Lo g gi n g
Page 21