1. Use the dsconfig command in non-interactive mode to create a result criteria object set to failure-result-codes, a predefined set of result codes that indicate when an operation did not complete successfully.
    $ bin/dsconfig create-result-criteria --type simple \
      --criteria-name "Failed Operations" --set result-code-criteria:failure-result-codes
  2. Use dsconfig to create the corresponding log publisher that uses the result criteria. The log rotation and retention policies are also set with this command.
    $ bin/dsconfig create-log-publisher \ 
      --type file-based-access \ 
      --publisher-name "Filtered Failed Operations" \ 
      --set enabled:true \
      --set log-connects:false \ 
      --set log-disconnects:false \ 
      --set log-requests:false \ 
      --set "result-criteria:Failed Operations" \ 
      --set log-file:logs/failed-ops.log \ 
      --set include-request-details-in-result-messages:true \ 
      --set "rotation-policy:7 Days Time Limit Rotation Policy" \ 
      --set "retention-policy:Free Disk Space Retention Policy"
  3. View the failed-ops.log in the logs directory. Verify that only information about failed operations is written to it.