How to rotate Audit logs in DSS

Solved!
kpk_devops
Level 1
How to rotate Audit logs in DSS

Hi Team,

we are having the default  audit log rotation ie the audit log file rotates  if it reaches 100MB in Design Node, but I want to configure Audit logs to rotate on daily basis, could anyone tell me how to setup this configuration.

Thanks in advance.

Regards,

PPK

0 Kudos
1 Solution
sergeyd
Dataiker

Hi @kpk_devops 

It's important to note that log retention is not time-based but size-based. So your audit.log files are rotated when they reach a given size and purged after a given number of rotations. If you need to change this, in your DSS_DATA_DIRECTORY, create a directory and subdirectory called resources/logging. In the logging directory, add a file called dku-log4j.properties. Fill it with the next lines (defaults):

log4j.appender.AUDITFILE.MaxFileSize=100MB
log4j.appender.AUDITFILE.MaxBackupIndex=20

or depending on your needs and restart DSS to apply the changes. 

View solution in original post

0 Kudos
3 Replies
sergeyd
Dataiker

Hi @kpk_devops 

It's important to note that log retention is not time-based but size-based. So your audit.log files are rotated when they reach a given size and purged after a given number of rotations. If you need to change this, in your DSS_DATA_DIRECTORY, create a directory and subdirectory called resources/logging. In the logging directory, add a file called dku-log4j.properties. Fill it with the next lines (defaults):

log4j.appender.AUDITFILE.MaxFileSize=100MB
log4j.appender.AUDITFILE.MaxBackupIndex=20

or depending on your needs and restart DSS to apply the changes. 

0 Kudos
kpk_devops
Level 1
Author

Thank you very much for the reply,  it worked and resolved my issue.

Also can you help what the different  properties values I can put in dku-log4j.properties file ? I know Size, BackupIndex, Day, is there any reference document for this properties values ?

 

Thanks in advance.

Regards,

PK

0 Kudos
sergeyd
Dataiker

Glad to hear this was helpful. In terms of DSS there are only these properties: 

log4j.appender.AUDITFILE=org.apache.log4j.RollingFileAppender
log4j.appender.AUDITFILE.File=${DIP_HOME}/run/audit/audit.log
log4j.appender.AUDITFILE.MaxFileSize=100MB
log4j.appender.AUDITFILE.MaxBackupIndex=20
log4j.appender.AUDITFILE.layout=com.dataiku.dip.logging.JSONAuditLayout

 

0 Kudos