Question

21
Views
Close popover
Nishanth P (NishanthP0577)
Pega One
Nishanth P
Pega One
DE
NishanthP0577 Member since 2014 3 posts
Pega One
Posted: March 11, 2020
Last activity: March 11, 2020
Closed

Log4j Regefilter not working for multiline log message

My application is currently printing logs as below, however, I need a regular expression to print the content inside {} in a separate file. 

<!-- RollingFile Appender for Elastic logs --> <RollingRandomAccessFile name="ElasticNew" fileName="${sys:pega.logdir}/ElasticNew.log" filePattern="${sys:pega.logdir}/PegaRULES-%d{MM-dd-yyyy}-%i.log.gz"> <RegexFilter regex="/{([^}]+)}/" onMatch="ACCEPT" onMismatch="DENY"/> <PatternLayout> <pattern>%d %X{userid}-%m%n</pattern> </PatternLayout> <Policies> <TimeBasedTriggeringPolicy /> <SizeBasedTriggeringPolicy size="250 MB"/> </Policies> </RollingRandomAccessFile>

Log:

2020-03-11 18:56:56,723 [http-nio-8080-exec-9] [TABTHREAD1] [ ] [ SrMgmt:01.01.01] ( mgmt.util.URLAccessContext) WARN localhost|0:0:0:0:0:0:0:1 - URLAccessModeWarn:URLAccessPermitted URLAccessDetail ActionTampered IActionRequest class instance is null. None of the parameters(fixed/enum/client) got registered.  

2020-03-11 18:56:57,540 [http-nio-8080-exec-9] [TABTHREAD1] [ ] [ SrMgmt:01.01.01] (gmt_Work_ServiceRequest.Action) INFO localhost|0:0:0:0:0:0:0:1 Admin.SrMgmt - { 

"pxObjClass":"Data-Party-Person" 

,"pyID":"S-40"

  }

expected Log to be printed in another file:

2020-03-11 18:56:57,540 [http-nio-8080-exec-9] [TABTHREAD1] [ ] [ SrMgmt:01.01.01] (gmt_Work_ServiceRequest.Action) INFO localhost|0:0:0:0:0:0:0:1 Admin.SrMgmt - { 

"pxObjClass":"Data-Party-Person" 

,"pyID":"S-40"

  } 

 

Reporting Insurance Senior System Architect
Moderation Team has archived post,
Close popover This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.