xref: /titanic_50/usr/src/man/man1m/msgid.1m (revision ed22c7109fc5dd9e1b7a5d0333bdc7ad2718e2ab)
te
Copyright (c) 2000, Sun Microsystems, Inc. All Rights Reserved
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
MSGID 1M "Oct 9, 1998"
NAME
msgid - generate message IDs
SYNOPSIS

/usr/sbin/msgid
DESCRIPTION

The msgid utility generates message IDs.

A message ID is a numeric identifier that uniquely identifies a message. Although the probability of two distinct messages having the same ID is high, this can be greatly reduced with the appropriate priority or facility.level designator (see syslogd(1M)). Specifically, the message ID is a hash signature on the message's unexpanded format string, generated by STRLOG_MAKE_MSGID() as defined in <sys/strlog.h>.

syslogd(1M) is a simple filter that takes strings as input and produces those same strings, preceded by their message IDs, as output. Every message logged by syslogd(1M) includes the message ID. The message ID is intended to serve as a small, language-independent identifier.

EXAMPLES

Example 1 Using the msgid command to generate a message ID

The following example uses the msgid command to generate a message ID for the echo command.

example# echo hello | msgid205790 hello

Example 2 Using the msgid command to generate a message catalog

The following example uses the msgid command to enumerate all of the messages in the binary ufs, to generate a message catalog.

example# strings /kernel/fs/ufs | msgid

137713 free:
 freeing free frag, dev:0x%lx, blk:%ld, cg:%d, ino:%lu, fs:%s
567420 ialloccg: block not in mapfs = %s
845546 alloc: %s: file system full
...
SEE ALSO

syslogd(1M), attributes(5), log(7d)