TAFJ Logging
TAFJ Logging
Revi si o
Dat e Ame n d e d Na m e De s c r i p t i o n
n
1 30 th Marc h 2019 TAFJ tea m Initial version
2 25 th Marc h 2020 S. Sakt hi R20 AMR Review
H. Sanofa r
3 14 th July 2020 Log4j 1.2 upd a t e
Nish a
2
TAFJ Logging
Copyri g h t
Pleas e includ e your na m e , comp a n y, addr e s s, and telep h o n e and fax num b e r s , and email add r e s s if
applica bl e. TAFJdev@t e m e n o s . c o m
4
TAFJ Logging
Log g e r
T24 execu tion and TAFJ inter n al behavior could be monitor e d with logs.
Sta n d a r d logging APIs (SLF4J, Log4J 1.2, Log4J 2.x) are use d and a default logge r configu r a ti o n, writing
to files is provide d within:
<TAFJ_HO M E > \ c o n f \ T A FJTr a c e . p r o p e r t i e s .
This configu r a t i o n could be eithe r a Log4J 1.2 or Log4J2 configu r a t io n, depe n di n g eithe r on your TAFJ
version or on the runti m e configu r a t i o n.
This file is gen e r a t e d auto m a t i c a lly in the appr o p ri a t e Log4j 1.2 or Log4j 2 form a t if it’s not alre a dy
existin g.
The configu r a t io n allows:
- Cha n gi n g the default log level for all logge r s.
For more inform a t i o n pleas e refer to the appro p r i a t e loggin g API docu m e n t a t i o n , links are provide d in
the relat e d section.
By default, seve r al differ e n t logge r s are define d, providing infor m a t io n relat e d to a specific topic: T24,
Data b a s e , Runtim e , MDB, EJB, etc…
Log api cu s t o m i z a t i o n
Since PB201 6 0 7 (June 2016 rele a s e ), historic al Log4j 1.2 configu r a t io n is switch e d to Log4j 2.
When upgr a di n g from an existin g installatio n to PB201 6 0 7 and highe r, any older existin g
TAFJTrac e. p r o p e r t i e s will be over ri d d e n to fit Log4j 2 form a t .
For backw a r d comp a ti bility this is still possibl e to use Log4j 1.2, but not reco m m e n d e d as furt h e r logging
enha n c e m e n t s are not going to be suppo r t e d with this log4j version.
Log 4j con fi g u r a t i o n
File TAFJTrac e . p r o p e r t i e s for mor e inform a ti o n see https://loggi n g. a p a c h e . o r g / log 4j/1.2/ m a n u a l . h t m l
Log 4j 2 co nf i g u r a t i o n
File TAFJTrac e . p r o p e r t i e s for mor e inform a ti o n see htt p://loggi n g. a p a c h e . o r g /l og 4j/ 2.x/
Clas s p a t h set u p
To be able to use SLF4J and Log4j 1.2, som e class p a t h modificatio n nee d s to be done .
1- Remove log4j- api.jar and log4j- core.ja r from <TAFJ_HO M E > \ l i b
o <TAFJ_HO M E > \ 3 r d P a r t y\ l o g g i n g \ s l f 4 j \ s l f 4j . l o g 4 j 1 2 . j a r
Run t i m e set u p
To switch from native Log4j2 API to SLF4J, simply set the following syste m prope r t y.
Set up throu g h JVM arg u m e n t (apps e rv e r mode):
-Dtem e n o s .log. a pi = S L F 4J
Or set up throu g h environ m e n t variabl e s (sta n d al o n e mode tafj shell):
- Linux :
- Windows
To switch from native Log4j2 API to Teme n o s Com m o n Logge r API, simply set the following syst e m
prop e r t y.
Set up throu g h JVM arg u m e n t (apps e rv e r mode):
-Dtem e n o s .log. a pi = COMMO N
Or set up throu g h environ m e n t variabl e s (sta n d al o n e mode tafj shell):
- Linux :
6
TAFJ Logging
o expor t tem e n o s_log_a pi = COMMO N
- Windows
With the Teme n o s COMMON logge r we have an option to choose the gen e r a t e log in one of the below
option (the r e by auto m a t i c a lly gen e r a t e the TAFJTrac e. p r o p e r t i e s on fly when missin g).
- STAN DAR D (default)
- SOCKET – redir e c t the appe n d e r s to logst a s h on localhost with defa ult port
- UNIQ UE - gene r a t e all the logs into a single file called tafj.log inst e a d of individu al log files per
modul e.
To switch the mode the following environ m e n t prop e r t y has to be set at star t u p.
- -Dt e m n . t a fj .l o g g i n g . g e n e r a t e . c o m m o n . a p p e n d e r s . m o d e =S OCKET
It has to be set at TAFJ star t up, and sh o u l d be don e thro u g h envir o n m e n t varia b l e s or JVM
arg u m e n t s
Run t i m e set u p
To switch from native Log4j2 API to Log4j 1.2, simply set the following syste m prop e r t y.
Set up throu g h JVM arg u m e n t (apps e rv e r mode):
-Dtem e n o s .log. a pi = L O G 4J
Or set up throu g h environ m e n t variabl e s (sta n d al o n e mode tafj shell):
- Linux :
- Windows
Log fold e r s cu s t o m i z a t i o n
By default you will find above mention e d logs unde r following folder s:
- <TAFJ_HO M E > / l o g : for TAFJ log s
This default beh avior could be over rid d e n by using following prop e r t i e s:
- te m e n o s . l o g . d i r e c t o r y = < PAT H_TO_YOUR_TAFJ_LOG_FOLDER >
It has to be set at TAFJ star t up, and sh o u l d be don e thro u g h envir o n m e n t varia b l e s or JVM
arg u m e n t s .
You canno t use the tafj.pro p e r t i e s file for that pur pos e as logge r s get initialized before tafj prope r ti e s get
loade d.
Set up throu g h JVM arg u m e n t (apps e rv e r mode):
-Dtem e n o s .log.di r e c t o r y = / p a t h / t o/yo u r / c u s t o m /l og/fold e r
- Windows
To reve r t this settin g in tafj shell, simply set the prop e r t y to an empty value.
- Linux :
- Windows
Log g i n g COMO
Whe n usi n g LOG4J2 as the logging API, it is possible to redi r e c t COMOs to a stan d a r d logge r.
It will gene r a t e the “como” logge r and app e n d e r configu r a t io n within TAFJTrac e configu r a ti o n.
When using an existing deploym e n t , make sur e to delet e curr e n t TAFJTrac e configu r a t i o n file.
8
TAFJ Logging
The como appe n d e r and logge r will be define d in the newly gene r a t e d configu r a t i o n file.
i.e. when using prope r ti e s configu r a t i o n form a t .
app e n d e r . c o m o . t y p e = Routi n g
app e n d e r . c o m o . n a m e = co m o
app e n d e r . c o m o . r o u t e s . t y p e = Rou t e s
appe n d e r . c o m o . r o u t e s . p a t t e r n = $$ { c t x:CO M O- NA M E }
appe n d e r . c o m o . r o u t e s . r o u t e 1 . t y p e = Rout e
a p p e n d e r . c o m o . r o u t e s . r o u t e 1 . f i l e . t y p e = Fi l e
app e n d e r . c o m o . r o u t e s . r o u t e 1 . f il e . n a m e = co m o- $ { c t x: CO M O- NA M E }
appe n d e r . c o m o . r o u t e s . r o u t e 1 . file .file N a m e = ${ s y s: t e m e n o s .l o g . dir e c t o r y . c o m o } / $
{ctx:CO MO- NAM E }
a p p e n d e r . c o m o . r o u t e s . r o u t e 1 . f i l e . l a y o u t . t y p e = Pa t t e r n L a y o u t
appe n d e r . c o m o . r o u t e s . r o u t e 1 . file .layo u t . p a t t e r n = %m% n
Above prop e r t i e s hav e to be set at TAFJ start up, and sh o u l d be don e thro u g h envir o n m e n t
variab l e s or JVM arg u m e n t s .
The above men tion e d routin g app e n d e r could be use d in conjun c tio n with a socke t app e n d e r to have
COMOs files gene r a t e d on a rem ot e logging serve r.
In this scen a r i o, TAFJ applica tio n will beco m e a client of the logging serve r.
The appe n d e r to use on TAFJTrac e configu r a t i o n side will be the following, i.e. whe n using prop e r t i e s
configu r a t io n form a t .
# S o c k e t cl i e n t a p p e n d e r t o b e u s e d t o r e d i r e c t c o m o fi l e s t o a b o v e r e m o t e r o u t i n g
appe n d e r
# S e t u p ap p r o p r i a t e ho s t n a m e an d po r t to m a t c h th e re m o t e log g i n g s e r v e r
appe n d e r . c o m o . t y p e = Soc k e t
app e n d e r . c o m o . n a m e = co m o
appe n d e r . c o m o . h o s t = 10.56. 7. 9 9
appe n d e r . c o m o . p o r t = 1212
appe n d e r . c o m o .l ay o u t . t y p e = Serializ e d L a y o u t
appe n d e r . c o m o . c o n n e c t Ti m e o u t M i llis = 2000
appe n d e r . c o m o . r e c o n n e c t i o n D e la y M illis = 1000 0
On the serve r side, the sam e routin g app e n d e r than define d above will be use d to receive the log event s
from the socke t and rout e the m to the app ro p r i a t e file.
1- Deploy on the logging serve r (LOG4J_HOME below) the following libra ri e s which can be found in
the TAFJ relea s e unde r 3rdP a r t y\log gi n g\log 4j 2:
o log4j- core.ja r
o log4j- api.jar
o jcom m a n d e r- 1.48.ja r
2- Copy on the serve r the TAFJTrac e configu r a t i o n defining the como routi ng app e n d e r
3- Sta r t the TCP socke t serve r with appro p r i a t e classp a t h and par a m e t e r s , i.e.
s e t L O G 4 J_ H O M E = C : \ l o 4 j - s o c k e t - s e r v e r - c o n f
se t CLA S S P A T H = % L O G 4J_HO M E % \*
s e t JA V A _ O P T S = - D t e m e n o s . l o g . d i r e c t o r y = % L O G 4 J _ H O M E % \ l o g
-D t e m e n o s . l o g . d i r e c t o r y . t 2 4 = % L O G 4 J _ H O M E % \ t 2 4 - l o g
-D t e m e n o s . l o g . d i r e c t o r y . c o m o = % L O G 4 J _ H O M E % \ c o m o - l o g
ja v a %J A V A _ O P T S % -c p % C L A S S P A T H %
o r g . a p a c h e . l o g g i n g . l o g 4 j . c o r e . n e t . s e r v e r . T c p S o c k e t S e r v e r -c % L O G 4 J _ H O M E
% \ T A F J T r a c e . x m l -p 1 2 1 2 --c l a s s e s ja v a . u t i l . C o l l e c t i o n s $ U n m o d i f i a b l e M a p --c l a s s e s
ja v a . u t i l . H a s h M a p
The TCP socke t serve r will be star t e d on the specified option -p port 1212 and defining the logge r
configu r a t io n comin g from option -c TAFJTrac e.x ml.
Com m u ni c a t i o n could optionally be secur e d by using SSL. Pleas e refe r to log4j2 docu m e n t a t i o n.
https://loggi n g. a p a c h e . o r g /lo g 4j/2.0/ m a n u a l/ a p p e n d e r s . h t m l # S o c k e tA p p e n d e r
In this case the client app e n d e r configu r a t i o n has to be refine d to define SSL par a m e t e r s .
i.e.
appe n d e r . c o m o . s s l. t y p e = SSL
appe n d e r . c o m o . s s l. p r o t o c ol = SSL
appe n d e r . c o m o . s s l. k e y s t o r e . t y p e = K e y S t o r e
appe n d e r . c o m o . s s l. k e y s t o r e .loc a tio n = l o g 4j 2- key s t o r e .j k s
appe n d e r . c o m o . s s l. k e y s t o r e . p a s s w o r d = c h a n g e m e
appe n d e r . c o m o . s s l. tr u s t s t o r e . t y p e = T r u s t S t o r e
appe n d e r . c o m o . s s l. tr u s t s t o r e .lo c a tio n = t r u s t o r e .j k s
appe n d e r . c o m o . s s l. tr u s t s t o r e . p a s s w o r d = c h a n g e m e
10
TAFJ Logging
Log g e r con t e x t
In a multi- tena n t environ m e n t you may want to define a specific logge r cont ext to differ e n t i a t e the logs
from the differ e n t tena n t s. It could also be useful for deb u g gi n g purpo s e wher e a user can define its own
cont ext.
By using prope r t y
- te m e n o s . l o g . c o n t e x t = <YOUR_CO NTEXT_NAME >
- Windows
To reve r t this settin g in tafj shell, simply set the prop e r t y to an empty value.
- Linux :
- Windows
To redi r e c t logs into Splunk inst a n c e , we nee d to modify the following prope r t y in tafj.pro p e r t i e s file
o tem n. t afj.r u n ti m e . r e d i r e c t i o n.log g e r =
By default, if the above mentio n e d prop e r t y is empty, logs will be gene r a t e d in filexplor e r .
If the splunk compo n e n t is provide d as the value for the above mentio n e d prop e r t y, logs will get
forwa r d e d to splunk.
ie) tem n. t afj.r u n ti m e . r e d i r e c t i o n.log g e r = s p l u n k
Specify the splunk URL and token using the below mentio n e d two prope r ti e s,
o tem n. t afj.r u n ti m e . r e d i r e c t i o n. s pl u n k .t ok e n =
By default, if the above mentio n e d prop e r t i e s are not provide d, the default URL and token use d.
ie) URL = htt p://loc al ho s t : 8 0 8 8
Token = 0fbb0 a 3 1- 4548- 4468- a49b- 64c36 1 b e 3 3 7 6
tCre a t e T r a c e W r i t e r
Once the above prop e r t i e s are define d in tafj.pro p e r t i e s file, user has to exec ut e tCre a t e T r a c e W ri t e r file
which is locat e d inside %TAFJ_HOME%\ bi n direc to ry in orde r to gen e r a t e the new TAFJTrac e . p r o p e r t i e s
file which is comp a ti bl e for Splunk compo n e n t .
The appe n d e r s will modified from Rolling file to HTTP.
ex) appe n d e r .T 2 4. t y p e = http
appe n d e r .T 2 4. n a m e = T24
appe n d e r .T 2 4. u rl = ${def a ul t U rl }
appe n d e r .T 2 4. t ok e n = ${def a ul tTok e n }
appe n d e r .T 2 4.l ayo u t . ty p e = Patt e r n L a y o u t
appe n d e r .T 2 4.l ayo u t . p a t t e r n = ${d efa ul t P a t t e r n }
When a tena n t I d is active, it will be rout e d to the tena n tI d direct o r y und e r defaultLogDi r e c t o r y
(gen e r a lly $TAFJ_HOME/log). For exa m pl e, if Tena n t I d 1 is active, logs for Tena n tI d 1 will appe a r unde r
$TAFJ_HOME/log/Te n a n t I d 1 direct o r y. If no tena n t is active, then logs appe a r nor m a lly in the
defaultLogDir e c t o r y. Likewise, COMO logs to the direct o ry define d by tem e n o s .lo g. di r e c t o r y.co m o
12
TAFJ Logging
(gen e r a lly $TAFJ_HOME/log_T24/ co m o if no tena n t is active). If Tena n t 1 is active, it would log to
$TAFJ_HOME/log_T24/co m o/Te n a n t 1 .
appe n d e r . c o m o . t y p e = Routin g
appe n d e r . c o m o . n a m e = como
appe n d e r . c o m o . r o u t e s . t y p e = Rout e s
appe n d e r . c o m o . r o u t e s . p a t t e r n = $${c tx:COMO- NAME}
appe n d e r . c o m o . r o u t e s . r o u t e 1 . t y p e = Rout e
appe n d e r . c o m o . r o u t e s . r o u t e 1 .file.typ e = File
appe n d e r . c o m o . r o u t e s . r o u t e 1 .file.n a m e = como- ${ctx:COMO- NAME}
appe n d e r . c o m o . r o u t e s . r o u t e 1 .file.fileN a m e = ${sys: t e m e n o s .l og. di r e c t o r y.c o m o } / $ { c t x: t e n a n t I d:- }/$
{ctx:COMO- NAME}
appe n d e r . c o m o . r o u t e s . r o u t e 1 .file.l ayou t .t yp e = Patt e r n L a y o u t
appe n d e r . c o m o . r o u t e s . r o u t e 1 .file.l ayou t . p a t t e r n = %m%n
Star ti n g R17 and above compila tion of JBC should make use
7 COMPON E N T_BUILDER of tCom p o n e n t B uil d e r and all inform a t i o n specific to
compilatio n will be logge d in this specific logge r.
22 JQL_NOTSUP P ORTED Transl a tio n of unsu p p o r t e d JQL com m a n d s will get logge d.
Sanity check tool will prod u c e the logs cont aini n g the
30 SANITYCHECK
applica tio n configu r a t i o n.
34 T24 Logs will get writt e n while workin g with T24 produ c t .
14
TAFJ Logging
35 TRUN Logs relat e d to tRun com m a n d exec utio n.
Cust o m Log g e r
Enable custo m logge r settin g the prop e r t y te m n . t a fj.r u n t i m e . e n a b l e . c u s t o m . l o g g e r = t r u e default its
false.
Define the custo m logge r(co m p o n e n t nam e and level) on <TAFJ_HOME > / c o nf- TAFJTrac e. p r o p e r t i e s as
like othe r com po n e n t (API,T24 etc.)
appe n d e r s = aa
appe n d e r . a a . t y p e = RollingFile
appe n d e r . a a . n a m e = aa
appe n d e r . a a .file N a m e = ${def a ul tLogDi r e c t o r y } / a a .lo g
appe n d e r . a a .file P a t t e r n = ${def a ul tLo gDi r e c t o r y }/ a a .l og.%i.gz
appe n d e r . a a .l ayo u t .t y p e = Patt e r n L a y o u t
appe n d e r . a a .l ayo u t . p a t t e r n = ${def a ul t P a t t e r n }
appe n d e r . a a . p olici e s.ty p e = Policies
appe n d e r . a a . p olici e s.siz e.ty p e = SizeBa s e d T ri g g e r i n g P olicy
appe n d e r . a a . p olici e s.siz e.siz e = $ { d e f a u l t M a x F il e Siz e }
appe n d e r . a a . s t r a t e g y . t y p e = DefaultR ollove r S t r a t e g y
appe n d e r . a a . s t r a t e g y . m i n = ${def a ul t Mi nB a c k u p I n d e x }
appe n d e r . a a . s t r a t e g y . m a x = ${d ef a ult M a xB a c k u p I n d e x }
16