Reduce the amount of log files

All Union Platform questions, comments, feature requests, and bug reports.

Reduce the amount of log files

Postby toby » Sun 09 Jul 2017 01:13

I keep debug logging on all the time - even in production - it's very useful both when problems occur, or you just need to see "what was happening" at any given time.

But there are some Union-generated lines in there which are of no use to me, probably of no use to Union (now, although they may have been at one time), and which constitute a majority of the contents of the logs.

The look like these:
2017-07-08 19:36:18,267 DEBUG - result row: EntityKey[net.user1.union.persistence.union.AccountAttribute#6292723]
and
2017-07-08 19:36:18,600 DEBUG - resolving associations for [net.user1.union.persistence.union.AccountAttribute#131187]
2017-07-08 19:36:18,600 DEBUG - done materializing entity [net.user1.union.persistence.union.AccountAttribute#131187]

They are associated with logins which use the Union login facility.

There are thousands upon thousands of these in there.

It is possible to filter them out before they are written to the logs.
Just add these lines to your log4j.properties file:
log4j.appender.union.filter.1=org.apache.log4j.varia.StringMatchFilter
log4j.appender.union.filter.1.StringToMatch=net.user1.union.persisten
log4j.appender.union.filter.1.AcceptOnMatch=false

You will need to have log4j.jar at (I believe) 1.2.16, or higher.
That may no longer be available, but 1.2.17 is (from apache).

NOTE: all of 1.2 has reached end of life, and they are now on level 2.x
but 1.2.17 is still there for download (as part of a bigger zip file).

It seems you can just swap in log4j-1.2.17.jar for whatever came with Union.
I do not know what the old version was, but it did not seem to work for this.

You can also specify log4j properties via an XML file, which might work in older log4j versions.
toby
 
Posts: 162
Joined: Sun 24 Jun 2012 14:18

Return to Union Platform

Online

Users browsing this forum: No registered users and 1 guest