Disable logging specific TI process in tm1s-log.properties
- qml
- MVP
- Posts: 1096
- Joined: Mon Feb 01, 2010 1:01 pm
- OLAP Product: TM1 / Planning Analytics
- Version: 2.0.9 and all previous
- Excel Version: 2007 - 2016
- Location: London, UK, Europe
Re: Disable logging specific TI process in tm1s-log.properties
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.
Kamil Arendt
- Hippogriff
- Posts: 48
- Joined: Thu Nov 19, 2015 4:02 pm
- OLAP Product: TM1
- Version: 10.2.2
- Excel Version: 2012
Re: Disable logging specific TI process in tm1s-log.properties
Many thanks. It makes sense, I suppose.
--
Cheers, Hippo
Cheers, Hippo
- Hippogriff
- Posts: 48
- Joined: Thu Nov 19, 2015 4:02 pm
- OLAP Product: TM1
- Version: 10.2.2
- Excel Version: 2012
Re: Disable logging specific TI process in tm1s-log.properties
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:
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
--
Cheers, Hippo
Cheers, Hippo
- Hippogriff
- Posts: 48
- Joined: Thu Nov 19, 2015 4:02 pm
- OLAP Product: TM1
- Version: 10.2.2
- Excel Version: 2012
Re: Disable logging specific TI process in tm1s-log.properties
I don't suppose anyone out there has ever got the log4j Threshold setting for an Appender working?
I can't get this working:
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.
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
--
Cheers, Hippo
Cheers, Hippo
- Hippogriff
- Posts: 48
- Joined: Thu Nov 19, 2015 4:02 pm
- OLAP Product: TM1
- Version: 10.2.2
- Excel Version: 2012
Re: Disable logging specific TI process in tm1s-log.properties
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.

--
Cheers, Hippo
Cheers, Hippo
- qml
- MVP
- Posts: 1096
- Joined: Mon Feb 01, 2010 1:01 pm
- OLAP Product: TM1 / Planning Analytics
- Version: 2.0.9 and all previous
- Excel Version: 2007 - 2016
- Location: London, UK, Europe
Re: Disable logging specific TI process in tm1s-log.properties
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. 

Kamil Arendt
-
- Posts: 119
- Joined: Mon Oct 27, 2014 10:50 am
- OLAP Product: TM1
- Version: 10.2.2
- Excel Version: 2013
Re: Disable logging specific TI process in tm1s-log.properties
Use your last breath and file it as a bug. Who knows... IBM might actually listen.
- Hippogriff
- Posts: 48
- Joined: Thu Nov 19, 2015 4:02 pm
- OLAP Product: TM1
- Version: 10.2.2
- Excel Version: 2012
Re: Disable logging specific TI process in tm1s-log.properties
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.
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.
Last edited by Hippogriff on Thu May 12, 2016 9:41 am, edited 1 time in total.
--
Cheers, Hippo
Cheers, Hippo
- qml
- MVP
- Posts: 1096
- Joined: Mon Feb 01, 2010 1:01 pm
- OLAP Product: TM1 / Planning Analytics
- Version: 2.0.9 and all previous
- Excel Version: 2007 - 2016
- Location: London, UK, Europe
Re: Disable logging specific TI process in tm1s-log.properties
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.Hippogriff wrote:I think that's the end of the road.
In any case, thanks for sharing your findings.
Kamil Arendt
- Hippogriff
- Posts: 48
- Joined: Thu Nov 19, 2015 4:02 pm
- OLAP Product: TM1
- Version: 10.2.2
- Excel Version: 2012
Re: Disable logging specific TI process in tm1s-log.properties
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!
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!

--
Cheers, Hippo
Cheers, Hippo
-
- MVP
- Posts: 264
- Joined: Mon Nov 03, 2014 8:23 pm
- OLAP Product: TM1
- Version: 9.5.2 10.1 10.2 PA2
- Excel Version: 2016
Re: Disable logging specific TI process in tm1s-log.properties
Have you tried using an appender other than the SharedMemoryAppender? It's not a standard log4cxx appender and might not implement the threshold setting.
- Hippogriff
- Posts: 48
- Joined: Thu Nov 19, 2015 4:02 pm
- OLAP Product: TM1
- Version: 10.2.2
- Excel Version: 2012
Re: Disable logging specific TI process in tm1s-log.properties
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.
I'm convinced this limitation is due to the fact we cannot use the DOMConfigurator.
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
--
Cheers, Hippo
Cheers, Hippo
-
- MVP
- Posts: 264
- Joined: Mon Nov 03, 2014 8:23 pm
- OLAP Product: TM1
- Version: 9.5.2 10.1 10.2 PA2
- Excel Version: 2016
Re: Disable logging specific TI process in tm1s-log.properties
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.
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.
- Hippogriff
- Posts: 48
- Joined: Thu Nov 19, 2015 4:02 pm
- OLAP Product: TM1
- Version: 10.2.2
- Excel Version: 2012
Re: Disable logging specific TI process in tm1s-log.properties
That's some good digging. 

--
Cheers, Hippo
Cheers, Hippo