Repotools - appending (rather than overwriting) log files
This might be a simple question with a simple solution - but I have yet to find it :-)
My team and I have developed some custom automation to add and remove (archive) users to RTC. Therefore part of the automation uses the repotools commands, syncusers and archiveusers specifically.
As part of the command we use the logfile attribute to write to a file, however by default the log file is overwritten every time. I would like to get the command to append to the log file rather than overwrite, as it would be helpful to have history of previous automation runs.
Does anyone know if this is possible with the command?
My team and I have developed some custom automation to add and remove (archive) users to RTC. Therefore part of the automation uses the repotools commands, syncusers and archiveusers specifically.
As part of the command we use the logfile attribute to write to a file, however by default the log file is overwritten every time. I would like to get the command to append to the log file rather than overwrite, as it would be helpful to have history of previous automation runs.
Does anyone know if this is possible with the command?
One answer
According to this wiki page https://jazz.net/wiki/bin/view/Deployment/ManipulatingCLMLog4j repotools logging can be manipulated via its log4j.properties files:
"repotools also has a log4j properties file, repotools_log4j.properties, in the install/server/conf directory as of CLM 4.0.5. There is also a "log4jproperties" argument for repotools"
From examination of a sample repotools_log4j.properties the default file appender appears to be the simple FileAppender:
log4j.appender.file=org.apache.log4j.FileAppender
You should be able to adjust the setting to an approprate file appender (perhaps RollingFileAppender) to provide the logging you need.
"repotools also has a log4j properties file, repotools_log4j.properties, in the install/server/conf directory as of CLM 4.0.5. There is also a "log4jproperties" argument for repotools"
From examination of a sample repotools_log4j.properties the default file appender appears to be the simple FileAppender:
log4j.appender.file=org.apache.log4j.FileAppender
You should be able to adjust the setting to an approprate file appender (perhaps RollingFileAppender) to provide the logging you need.
Comments
Thanks Alan,
I will give this a try. Part of the complication (or difference) here is that the automation is not running on a system with a full RTC/CLM install, it runs separately with copies of the repotools.sh files - so I am hoping if I put a repotools_log4j.properties file in the same folder it will find it.