How to rotate Audit logs in DSS

kpk_devops
kpk_devops Registered Posts: 7 ✭✭✭

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

Best Answer

  • Sergey
    Sergey Dataiker, Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS Core Concepts Posts: 365 Dataiker
    edited July 17 Answer ✓

    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 <span class="pre">resources/logging</span>. In the logging directory, add a file called <span class="pre">dku-log4j.properties</span>. 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.

Answers

  • kpk_devops
    kpk_devops Registered Posts: 7 ✭✭✭

    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

  • Sergey
    Sergey Dataiker, Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS Core Concepts Posts: 365 Dataiker
    edited July 17

    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

Setup Info
    Tags
      Help me…