sun.com | docs.sun.com | How To Buy | My Sun | Worldwide Sites |  |

| Previous Contents Index Next
3. Chapter 2 # Accessing and Maintaining Log Files Information, error, and alert messages are logged to system log files. Use the system log files to diagnose problems or errors. By configuring the log files, you can direct different categories of messages to files or to the console window. In this way, you can make the information in logs more accessible and prevent the occurrence of large log files. For information about using log files generated by the Solaris operating system and the Foundation Services, consult the `syslog`(3) and `syslogd`(1M) man pages. This chapter contains the following sections: Accessing System Log Files Accessing Internationalized Message Catalogs Maintaining System Log Files Logging NFS Operations ## Accessing System Log Files All information, error, and alert messages generated by the Foundation Services are sent to the system log files. The messages can be processed by client programs or by the Node Management Agent (NMA). To configure your access to the system log files, edit the`/etc/syslog.conf` file. You can add or change the message sources, priorities, and message locations according to the syntax described in the `syslog.conf`(4) man page. See the man pages of the individual daemons for details of the error levels used by each service. All Foundation Services messages have the `syslog` facility set to `local0`. You can configure system log files to contain selected categories of messages. The Foundation Services have the following error message categories: `emerg` `alert` `crit` `err` `info` `none` `notice` For information about error message categories, see the `syslog.conf`(4) man page. Note - The console window on the Netra CP21xx board is a 9600-bps serial line. If you are using a Netra CP21xx board, configure the `syslog.conf` file to direct messages to files. ### To Redirect Foundation Services Messages to a File on the Master Node This procedure redirects specific categories of messages to log files. Log in as superuser to the node for which you want to redirect messages. Open the `/etc/syslog.conf` file in a text editor. To redirect the `info` and `notice` messages to a log file called logfile, add the following line to the `/etc/syslog.conf` file:
       local0.info;local0.notice / ifdef /var/adm/logfile
5. Note - Use tabulation in the `/etc/syslog.conf` file. Save the `/etc/syslog.conf` file and exit the text editor. Create a `/var/adm/`logfile`` file if this file does not already exist:
       # touch /var/adm/logfile
6. Stop the `syslogd` daemon:
       # /etc/init.d/syslog stop
7. Restart the `syslogd` daemon:
       # /etc/init.d/syslog start
4. ### To Define `loghost` in `/etc/hosts` This procedure configures messages to be sent to a specific node. This procedure can be used to prevent disruption of Network File System (NFS) traffic by high volumes of messages. Log in to the master node as superuser. In a text editor, open the `/etc/hosts` file for the diskless node. If your cluster was created by the `nhinstall` tool, the `/etc/hosts` file is located at `/export/root/`diskless-node-name``/etc/hosts. Remove the `loghost` state for the `localhost` entry. Enter the `loghost` state for the `cgtp0` address of the master node. For example:
       10.x.3.y	master		loghost
6. If the master node is using a default class C address, `10.x.3.y` is the IP address of the `cgtp0` interface. The system log messages are directed to the logfile specified for the master node. Save the `/etc/hosts` file and exit the text editor. Stop the `syslogd` daemon:
       # /etc/init.d/syslog stop
7. Restart the `syslogd` daemon:
       # /etc/init.d/syslog start
2. System log messages are sent to the node specified in the `/etc/hosts` file. The node can be the current node or any other peer node. On the specified node, the messages are logged to a file called logfile, specified in the `/etc/syslog.conf` file. For information about redirecting messages to a nonpeer node, see To Redirect System Log Messages to a Nonpeer Node. ## Accessing Internationalized Message Catalogs Messages generated by the Foundation Services are stored in message catalogs. You can set the access permissions to the internationalized catalogs in one of the following ways: Set the access permissions for an individual shell session, as described in To Set `NLSPATH` for an Individual Shell Session. Set the access permissions permanently, as described in To Set `NLSPATH` Permanently. ### To Set `NLSPATH` for an Individual Shell Session Log in to a peer node. Set the language:
       # LANG=C
3. The default language is English. Export the language:
       # export LANG
4. Set the National Language Support (NLS) path:
       # NLSPATH=/opt/SUNWcgha/lib/locale/%L/LC_MESSAGES/%N
5. Export the path:
       # export NLSPATH
Previous Contents Index Next

Copyright 1994-2004 Sun Microsystems