The following example uses dsconfig non-interactive mode to illustrate the steps to configure the log publisher and the external database server presented in the previous section.

  1. Use dsconfig with the --no-prompt option to create the JDBC external server.
    $ bin/dsconfig --no-prompt create-external-server \ 
      --server-name jdbc-external \ --type jdbc \ 
      --set jdbc-driver-type:oraclethin \
      --set database-name:ubid_access_log \ 
      --set server-host-name:localhost --set server-port:1541
  2. Use dsconfig to create the log publisher.
    $ bin/dsconfig --no-prompt create-log-publisher \ 
      --publisher-name jdbc-test \ 
      --type jdbc-based-access \ 
      --set enabled:true \
      --set server:jdbc-external \ 
      --set "log-field-mapping:Simple JDBC Access Log Field Mappings"
  3. When the JDBC Log Publisher is created, the Directory Server automatically generates a DDL file of the Log Field Mappings in the <server-root>/logs/ddls/<name- of-logger>.sql file. Import the DDL file to your database.
    The procedure to configure the JDBC-Based Error Log Publisher is similar to creating a JDBC-Based Access Log Publisher. You can run the previous dsconfig command with the --type jdbc-based-error as follows:
    $ bin/dsconfig --no-prompt create-log-publisher \ 
    --publisher-name jdbc-error-test \ 
    --type jdbc-based-error \ 
    --set enabled:true \
    --set server:jdbc-external \
    --set "log-field-mapping:Simple JDBC Access Log Field Mappings"