DS uses log publishers to define log details for each log type, including the log location and name.
You can change the log location and/or log name by using dsconfig and updating the value of the log-file property. For example, this property defaults to logs/access for the access log, which is a relative path to the DS directory.
You can run the dsconfig command to change this. For example:
- DS 7 and later: $ ./dsconfig set-log-publisher-prop --publisher-name [publisherName] --set log-file [filePath] --hostname ds1.example.com --port 4444 --bindDN uid=admin --bindPassword password
- Pre-DS 7: $ ./dsconfig set-log-publisher-prop --publisher-name [publisherName] --set log-file [filePath] --hostname ds1.example.com --port 4444 --bindDN "cn=Directory Manager" --bindPassword password
Where [publisherName] is the name of the specific log you are updating. See About Logs for different log types and their corresponding name.
Alternatively, if you run dsconfig in interactive mode, you can navigate to: 21) Log Publisher > 3) View and edit > [Log File Type] > 5) log-file and amend the name and location. You can enter a full path, such as /logs/ds, rather than one that is relative to the DS directory if required.
You can also configure the log retention and log rotation options in a similar way using the dsconfig set-log-retention-policy-prop and dsconfig set-log-rotation-policy-prop commands respectively, or by navigating to 22) Log Retention Policy and 23) Log Rotation Policy when using dsconfig in interactive mode.