Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can someone point me to the location of, and correct configuration of the mdm-job.log? It appears the config is in {install}/mdm/conf/log4j-jobox.properties but I can't seem to get it setup to use the DailyRollingFileAppender.
Any advice appreciated.
Original:
log4j.rootCategory=INFO,CONSOLE,FILE
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%p [%c] - %m%n
log4j.appender.FILE=org.apache.log4j.RollingFileAppender
log4j.appender.FILE.File=${mdm.root}/logs/mdm-job.log
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern=%d %p [%c] - %m%n
Modified:
log4j.rootCategory=INFO,CONSOLE,FILE
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%p [%c] - %m%n
##log4j.appender.FILE=org.apache.log4j.RollingFileAppender
log4j.appender.FILE=org.apache.log4j.DailyRollingFileAppender
log4j.appender.FILE.File=${mdm.root}/logs/mdm-job.log
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
##log4j.appender.FILE.layout.ConversionPattern=%d %p [%c] - %m%n
log4j.appender.FILE.layout.ConversionPattern=%d{'.'yyyy-MM-dd} %p [%c] - %m%n
Hello,]
If you are trying to capture MDM Log in Version 6.x, please check this list:
MDM Server: web application (/talendmdm) deployed on embedded application server JBOSS or Tomcat.
MDM Server logs are located at <MDM_ROOT>/logs where MDM_ROOT is typically the following:
Windows: MDM_ROOT can be C:\Talend\6.5\mdm
Linux: MDM_ROOT can be /opt/Talend/6.5/mdm
All MDM log files are cycled with the date attribute, e.g mdm.log.01/21/2019
How to download MDM Logs
*** Version 6.x ***
MDM Configuration File:
<MDM_HOME>/conf/mdm.conf
------------------------------------------
Datasources configuration file:
<MDM_HOME>/conf/
Thanks Sabrina. Confirming that the configuration for mdm-jobs.log is at <MDM_HOME>/conf/log4j-jobox.properties
This is the configuration I was referencing, however it does not cycle with the date like you suggest. It only appends to a single log file. My original configuration is above (v6.3). Can someone share a log4j-jobox.properties configuration that does cycle daily?
Thanks
Hi,
Have a look at the log4J documentation https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/DailyRollingFileAppender.html, you will have to set a date pattern option (outside the layout pattern) such:
log4j.appender.RollingAppender=org.apache.log4j.DailyRollingFileAppender log4j.appender.RollingAppender.File=${mdm.root}/logs/mdm-job.log log4j.appender.RollingAppender.DatePattern='.'yyyy-MM-dd log4j.appender.RollingAppender.layout=org.apache.log4j.PatternLayout log4j.appender.RollingAppender.layout.ConversionPattern=%d %p [%c] - %m%n
Thank you, this gets me a little closer; however the appender does not write out a new file each day with the date appended to the file name. It does cycle every day and recreate the mdm-job.log file. This helps keep the size of that log down, but I am missing the historical data. Here is the configuration I have in log4j.jobox.properties. What else am I missing?
### ====================================================================== ###
## ##
## Jobox Log4j Configuration ##
## ##
### ====================================================================== ###
log4j.rootCategory=INFO,CONSOLE,JOBFILE
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%p [%c] - %m%n
log4j.appender.JOBFILE=org.apache.log4j.DailyRollingFileAppender
log4j.appender.JOBFILE.File=${mdm.root}/logs/mdm-job.log
log4j.appender.JOBFILE.DatePattern='.'yyyy-MM-dd
log4j.appender.JOBFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.JOBFILE.layout.ConversionPattern=%d %p [%c] - %m%n
from the Log4J doc:
For example, if the File option is set to /foo/bar.log and the DatePattern set to '.'yyyy-MM-dd, on 2001-02-16 at midnight,
the logging file /foo/bar.log will be copied to /foo/bar.log.2001-02-16 and logging for 2001-02-17 will continue in /foo/bar.log until it rolls over the next day.
So it is expected at each day new content is added from scratch to the same file. Do you mean you lost the .log.xxxx-xx-xx files from the days before?
Yes, the mdm-job.log is overwritten each day and I lose the mdm-job.log.xxxx.xx.xx (actually it's never created).
I also tried this configuration with the append declaration;
log4j.appender.JOBFILE.Append=true
This produced the same result.