Configuring syslog-ng to create logs for ldm

Become root:
$ su -
<password>

Create the directory where log files will be recorded and create the first log file and set the permissions:
# mkdir -p /var/log/ldm/
# touch /var/log/ldm/ldmd.log
# chown -R ldm:unidata /var/log/ldm/
# chmod 0750 /var/log/ldm/
# chmod 0640 /var/log/ldm/ldmd.log

Edit the syslog-ng.conf:
# vi /etc/syslog-ng/syslog-ng.conf

Add the following lines to the end of file:

# UNIDATA's LDM configuration
filter f_ldm     { facility(local1); };
destination ldmd { file("/var/log/ldm/ldmd.log"
                        owner(ldm) group(unidata)
                        perm(0644)
                       );
                 };
log { source(src); filter(f_ldm); destination(ldmd); };

Now you have to restart syslog-ng daemon:
# /sbin/syslog-ng restart

Exit from root and turns ldm user:
# exit
$ su - ldm
<password>

Access the home directory of ldm and create a symbolic link named "logs" to the log folder:
$ cd $HOME
$ ln -sf /var/log/ldm logs

Done. Now the syslog-ng is able to log the ldm messages.

ATENTION: If you compiled ldm to use the local1 facility or anyother else, change the configuration for ldm in the syslog-ng. All that match local0 must be chaged to the correct facility.

CAUTION: The /var directory is a system directory. If the log files are too big, the /var area might be full and compromises your system.