[SOLVED] Is there any way to exclude certain lines to be logged in the main log4j?

Description
SteffPoint
Posts: 79
Joined: Wed Mar 07, 2018 1:06 pm
Location: Germany

[SOLVED] Is there any way to exclude certain lines to be logged in the main log4j?

Postby SteffPoint » Fri May 03, 2019 5:11 am

We experience a really quick size-climbing of our main Log-File of Polarion, so that we come up with the question, if it's possible to exclude certain things to be logged, such as every line including for example:

Code: Select all

"Render Widget for preview"



Kind Regards,
Steff
Last edited by SteffPoint on Thu Nov 07, 2019 6:08 am, edited 1 time in total.

Jürgen
Posts: 99
Joined: Tue Sep 12, 2017 1:02 pm

Re: Is there any way to exclude certain lines to be logged in the main log4j?

Postby Jürgen » Mon May 06, 2019 8:59 am

Hi, Steff

Polarion is basically using log4j for writing log files, so everything that is available there should also be possible with Polarion.

First thing you could try of course is reducing the LogLevel. But probably you want to have something more sophisticated, so I looked around and found this: https://community.hortonworks.com/artic ... tries.html

I have never tried that so I can't tell how this will work.

Jürgen

SteffPoint
Posts: 79
Joined: Wed Mar 07, 2018 1:06 pm
Location: Germany

Re: Is there any way to exclude certain lines to be logged in the main log4j?

Postby SteffPoint » Thu Nov 07, 2019 6:08 am

Hello Jürgen,

sorry for my late response, but I could make it working with your kicking off help :)

Firstly, I suggest to copy the log4j.properties file from:

Code: Select all

C:\Polarion\polarion\plugins\org.apache.log4j_...


to:

Code: Select all

C:\Polarion\polarion\configuration


The first one is the original source, however, Polarion first grabs a log4j.properties file in the configuration folder if there is any.

Then, in the file:

Code: Select all

C:\Polarion\polarion\configuration\log4j.properties


I have added following lines:

Code: Select all

log4j.appender.A2.filter.01=org.apache.log4j.varia.StringMatchFilter
log4j.appender.A2.filter.01.StringToMatch=Render Widget for preview
log4j.appender.A2.filter.01.AcceptOnMatch=false


As Polarion loads the file at start up, one needs to restart the Polarion JavaService in order to make the change effective.

With the code above, log lines including "Render Widget for preview" won't be logged anymore.


Kind Regards,
Steffen


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: Bing [Bot] and 11 guests