Page 2 of 2
Re: Disable logging specific TI process in tm1s-log.properties
Posted: Fri May 06, 2016 10:19 am
by qml
Logging level is a property of the logger, not of the appenders you attach to it. Therefore I would say a specific logger can indeed only have one level at a time and your tests seem to support that.
Re: Disable logging specific TI process in tm1s-log.properties
Posted: Fri May 06, 2016 10:25 am
by Hippogriff
Many thanks. It makes sense, I suppose.
Re: Disable logging specific TI process in tm1s-log.properties
Posted: Fri May 06, 2016 11:26 am
by Hippogriff
Earlier I experienced a situation where 2 Appenders for the TM1 Logger, both at INFO, caused only the second file to be written to -
tm1server.log was not written to. This did bamboozle me.
This .properties file now seems to work as I would've expected,
both files are written to with the same stuff:
Code: Select all
log4j.logger.TM1=INFO, S1
log4j.appender.S1=org.apache.log4j.SharedMemoryAppender
log4j.appender.S1.MemorySize=5 MB
log4j.appender.S1.MaxFileSize=100 MB
log4j.appender.S1.MaxBackupIndex=20
log4j.appender.S1.TimeZone=GMT
log4j.logger.TM1=INFO, S2
log4j.appender.S2=org.apache.log4j.SharedMemoryAppender
log4j.appender.S2.MemorySize=5 MB
log4j.appender.S2.MaxFileSize=100 MB
log4j.appender.S2.File=C:/TM1LOGGING/errorsonly.log
log4j.appender.S2.MaxBackupIndex=20
log4j.appender.S2.TimeZone=GMT
log4j.additivity.TM1.S2=true
Re: Disable logging specific TI process in tm1s-log.properties
Posted: Fri May 06, 2016 2:28 pm
by Hippogriff
I don't suppose anyone out there has ever got the log4j Threshold setting for an Appender working?
I can't get this working:
Code: Select all
log4j.rootLogger=INFO, S1, S2
log4j.appender.S1=org.apache.log4j.SharedMemoryAppender
log4j.appender.S1.MemorySize=5 MB
log4j.appender.S1.MaxFileSize=100 MB
log4j.appender.S1.MaxBackupIndex=20
log4j.appender.S1.TimeZone=GMT
log4j.appender.S2=org.apache.log4j.SharedMemoryAppender
log4j.appender.S2.MemorySize=5 MB
log4j.appender.S2.MaxFileSize=100 MB
log4j.appender.S2.File=C:/TM1LOGGING/errorsonly.log
log4j.appender.S2.MaxBackupIndex=20
log4j.appender.S2.TimeZone=GMT
log4j.appender.S2.Threshold=ERROR
log4j.logger.TM1=INFO
I thought this
may override the common INFO setting across S1 and S2 and allow INFO and above to go to
tm1server.log and ERROR and above go to
errorsonly.log. No banana, it writes all levels (INFO and above) to both files. I tried it with S2 defined as a FileAppender too. I had high hopes for this.
Re: Disable logging specific TI process in tm1s-log.properties
Posted: Tue May 10, 2016 8:51 am
by Hippogriff
OK, giving up on this with good grace now

- I cannot ascertain that TM1 is paying
any attention to the log4j
log4j.appender.S2.Threshold setting.
Re: Disable logging specific TI process in tm1s-log.properties
Posted: Tue May 10, 2016 10:16 am
by qml
All human endeavours can be divided into two broad categories: those that are successful and those that are rich in learning opportunities. This was probably the latter kind.

Re: Disable logging specific TI process in tm1s-log.properties
Posted: Tue May 10, 2016 3:53 pm
by Bakkone
Use your last breath and file it as a bug. Who knows... IBM might actually listen.
Re: Disable logging specific TI process in tm1s-log.properties
Posted: Thu May 12, 2016 9:22 am
by Hippogriff
I didn't actually put this down as I claimed I would.
I've still not gotten this working, but I'm now concluding it's because I cannot. I found out that TM1 uses log4cxx - a version from 2003 or something - that is based on log4j and log4cxx has the ability to use Threshold (and also cool things like Filters) but it seems that these need to be set up via an XML configuration file, rather than the Properties file we are using. The way the TM1 Server addresses its configuration file
appears to be hard-coded into tm1server.dll so you cannot coax TM1 into using an XML configuration file for log4cxx... therefore you cannot use what log4cxx considers 'advanced features' like Filters.
https://svn.apache.org/repos/asf/loggin ... rator.html says - "The PropertyConfigurator does not handle the advanced configuration features supported by the DOMConfigurator such as support for Filters, custom ErrorHandlers, nested appenders such as the AsyncAppender, etc."
I
think that's the end of the road.
Re: Disable logging specific TI process in tm1s-log.properties
Posted: Thu May 12, 2016 9:33 am
by qml
Hippogriff wrote:I think that's the end of the road.
It doesn't have to be. An RFE for this could maybe, conceivably, potentially, imaginably, perhaps, feasibly be accepted as it shouldn't be
too difficult to move to a newer version of log4j.
In any case, thanks for sharing your findings.
Re: Disable logging specific TI process in tm1s-log.properties
Posted: Thu May 12, 2016 9:43 am
by Hippogriff
True.
It wouldn't necessarily need to be a newer version... just TM1 having the ability to point to a
log4cxx.xml configuration file rather than
tm1s-log.properties.
Or
tm1s-log.xml!

Re: Disable logging specific TI process in tm1s-log.properties
Posted: Fri May 13, 2016 5:20 pm
by BrianL
Have you tried using an appender other than the SharedMemoryAppender? It's not a standard log4cxx appender and might not implement the threshold setting.
Re: Disable logging specific TI process in tm1s-log.properties
Posted: Mon May 16, 2016 1:04 pm
by Hippogriff
Hi,
Good question. Yes, I did - I noted that
Filters, the
LevelMatchFilter and the
FileAppender were all features in the first version - 0.0.1 in 2003 - so I tried with that - no joy.
Code: Select all
log4j.appender.S3=org.apache.log4j.FileAppender
log4j.appender.S3.append=true
log4j.appender.S3.file=C:/TM1LOGGING/test.log
log4j.appender.S3.layout=org.apache.log4j.PatternLayout
log4j.appender.S3.layout.ConversionPattern=%-5p %c: %m%n
log4j.appender.S3.filter.1=org.apache.log4j.varia.LevelMatchFilter
log4j.appender.S3.filter.1.LevelToMatch=ERROR
log4j.appender.S3.filter.1.AcceptOnMatch=true
I'm convinced this limitation is due to the fact we cannot use the
DOMConfigurator.
Re: Disable logging specific TI process in tm1s-log.properties
Posted: Tue May 17, 2016 9:41 pm
by BrianL
Looks like 'Threshold' filtering is unavailable due to a (old) bug in log4cxx
https://issues.apache.org/jira/browse/LOGCXX-28
Since there is a fix available you might be able to file a bug with IBM and push them to apply the fix.
As for the other 'Filter' options in log4j/log4cxx being unavailable when using the PropertyConfigurator, this doesn't appear to even be logged as a bug with the project.
You could of course try a bug with IBM, but I think your far less likely to convince them to change the config file than accept the fix for the 'Threshold' setting.
Re: Disable logging specific TI process in tm1s-log.properties
Posted: Wed May 18, 2016 5:53 am
by Hippogriff
That's some good digging.
