Chapter 10. In Depth

This chapter explains some internal details you can be interested in when you are dealing with complex environments.

Logging

The LIXA project software uses standard UNIX logging syslog() function but it does not set a specific facility using the openlog() function. The final destination of the log messages depends on the configuration of the standard UNIX logging; Ubuntu 8.04, for examples, sends the messages to file /var/log/daemon.log. This should be in accordance with the content of the syslog man page LOG_DAEMON system daemons without separate facility value.

The messages produced by the LIXA project software are documented in the file src/common/lixa_syslog.h

The messages produced by the LIXA project software use two different prefixes: LXC for lixac (client library) and LXD for lixad (state server). Try the following example:

tiian@ubuntu:~$ ps -ef|grep lixad|grep -v grep
tiian@ubuntu:~$ /opt/lixa/bin/lixat
tx_open(): -7	
      

inspecting the log file /var/log/daemon.log you should find out something like this:

Dec  4 18:16:10 ubuntu lixat[6538]: LXC000I this process is starting a new LIXA transaction manager (lixa package version is 0.5.36)
Dec  4 18:16:10 ubuntu lixat[6538]: LXC002E unable to connect to LIXA server at address 127.0.0.1, port 2345
      

the lixat command is running as expected because the state server is not active. To see the messages produced by the state server you can try the following commands:

tiian@ubuntu:~$ sudo su - lixa
lixa@ubuntu:~$ /opt/lixa/sbin/lixad -d
lixa@ubuntu:~$ pkill lixad
lixa@ubuntu:~$ exit
logout
      

inspecting the log file /var/log/daemon.log you should find out something like this:

Dec  4 18:22:46 ubuntu lixad[6694]: LXD000N this process is starting a new LIXA server (lixa package version is 0.5.36)
Dec  4 18:22:46 ubuntu lixad[6697]: LXD014N LIXA server entered daemon status
Dec  4 18:22:49 ubuntu lixad[6697]: LXD019N received signal 15, server immediate shutdown in progress...
Dec  4 18:22:49 ubuntu lixad[6697]: LXD006N server terminated activities
      

The log messages are differentiated by priority; there is a direct link between the letter in the seventh position and the severity of the message:

  • D : LOG_DEBUG

  • I : LOG_INFO

  • N : LOG_NOTICE

  • W : LOG_WARNING

  • E : LOG_ERR

  • C : LOG_CRIT

If LIXA software was logging too much in your production environment you can configure the system log facility (/etc/syslog.conf) to filter some messages, but this tuning operation should not be necessary because the LIXA software does not use the system log facility as a debugging tool: look at the section called “Tracing” to discover how debug messages are managed.