Operating System - HP-UX
1819870 Members
2424 Online
109607 Solutions
New Discussion юеВ

syslog and facility level

 
tash S
Frequent Advisor

syslog and facility level

Hello All,

Our application prints the syslog the following format on Solaris.
aaa [xxxx user.info] zzz

But when we try to migrate the application on HP-UX 11i from Solaris, the syslog can not generate the facility level that means like "use.info".

We add the syslog.conf and
/sbin/init.d/syslogd stop
/sbin/init.d/syslogd start

==================
...
*.err /var/adm/syslog/syslog.log
*.info /var/adm/syslog/syslog.log

==================

Is this the same mechanism between Solaris and HP-UX 11i?
or do we miss something procedure ?

Thanks,
-tash S
6 REPLIES 6
Peter Godron
Honored Contributor

Re: syslog and facility level

Hi,
what happens in the /var/adm/syslog/syslog.log file if you do:
logger -p user.info -t USER_INFO TESTINGINFO
logger -p user.warn -t USER_WARN TESTWARNING
Bill Hassell
Honored Contributor

Re: syslog and facility level

The facility and priority names are documented in the man page for syslog. There is no facility called "use". You probably mean "user.info" which you can generate using logger and see the result in syslog.log:

logger -p user.info "This is a test"

Here are the facility names in HP-UX:
KERN
USER
MAIL
DAEMON
AUTH
SYSLOG
LPR
NEWS
UUCP
CRON
LOCAL0-7

And these are the priority names:
EMERG
ALERT
CRIT
ERR
WARNING
NOTICE
INFO
DEBUG


Bill Hassell, sysadmin
florin_10
Frequent Advisor

Re: syslog and facility level

Hi Tash

Between facitily level and logging file HAVE to use TABs ONLY; spaces will not work.
Also sendig a -HUP to syslogd (or starting/stopping as you did) after any change in the sys.conf file is neccesary.
The concept is identical between the two UNIX flavors.

Cheers
Florin
tash S
Frequent Advisor

Re: syslog and facility level

Hi All,

The question is that How to show facility level which is similar to Solaris?

# logger -p user.info "This is a test"

===================
Aug 23 3:14:11 xxx-hp root: This is a test
===================

Here is Solaris running example.

# logger -p user.info "This is a test"
===================
Aug 23 3:22:41 xxxx root: [ID 702911 user.info] This is a test
===================


You can see ID and "use.info"

Thanks,
-tash S
Bill Hassell
Honored Contributor

Re: syslog and facility level

The syslogd man page will help. The option is -v which will add the facility and priority level in front of the hostname for each message. NOTE: This is a simple 2-character code like 6D which means: DAEMON:INFO or 2A which is KERN:CRIT. You can manually decode the these characters with the syslog man page or use the attached script. It reports only those lines in the file that have the codes added. It will also read any other file including a compressed syslog file.


Bill Hassell, sysadmin
florin_10
Frequent Advisor

Re: syslog and facility level

The following is an extract from http://docs.hp.com/en/B2355-60105/logger.1.html

Send output from the users command (see users(1) to the syslogd daemon, marked as level info and facility local0. The message is tagged with the string USERS:

users | logger -p local0.info -t USERS

cheers
florin