1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
|
.\" Copyright (C) 1995 Andries Brouwer (aeb@cwi.nl)
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date. The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein. The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" Written 11 June 1995 by Andries Brouwer <aeb@cwi.nl>
.\"
.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
.\" all rights reserved.
.\" Translated Tue Mar 4 00:05:26 JST 1997
.\" by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\"
.\"WORD: kernel ͥ
.\"WORD: message ring buffer åХåե
.\"WORD: library 饤֥
.\"WORD: kernel log buffer ͥ롦Хåե
.\"WORD: console
.\"WORD: kernel panic ͥ롦ѥ˥å
.\"WORD: loglevel ٥
.\"WORD: debug message ǥХåå
.\"
.TH SYSLOG 2 "11 June 1995" "Linux 1.2.9" "Linux Programmer's Manual"
.SH ̾
syslog \- ͥ(kernel)ΥåХåեɤ
õ(clear)ꤹ; console_loglevel ꤹ롣
.SH
.nf
.B #include <unistd.h>
.sp
.B #include <linux/unistd.h>
.sp
.B _syscall3(int, syslog, int, type, char *, bufp, int, len);
.sp
.BI "int syslog(int " type ", char *" bufp ", int " len );
.fi
.SH
Ϥ֤ʤ̣äƤؿǤϤʤ
C Υ饤֥ؿǤ
.BR syslog (3)
뤳ȡΥڡΥƥࡦؿˤĤƤΤ
ҤƤ롣
\fItype\fP
.BR syslog ưꤹ롣
.IR kernel/printk.c
ΰ :
.nf
/*
* Commands to sys_syslog:
*
* 0 -- Close the log. Currently a NOP.
* 1 -- Open the log. Currently a NOP.
* 2 -- Read from the log.
* 3 -- Read up to the last 4k of messages in the ring buffer.
* 4 -- Read and clear last 4k of messages in the ring buffer
* 5 -- Clear ring buffer.
* 6 -- Disable printk's to console
* 7 -- Enable printk's to console
* 8 -- Set level of messages printed to console
*/
.fi
root Ǥʤץˤϵǽ 3 ΤߤĤƤ롣
.B ͥ롦Хåե(kernel log buffer)
.br
ͥĹ LOG_BUF_LEN (4096, 1.3.54 8192, 2.1.113 16384)
νΥХåեäƤꡢ
ˤϥͥؿ \fIprintk\fP() ΰȤͿ줿
å(Υ٥(loglevel)ˤ餺)Ǽ롣
.B syslog
.RI (2, buf , len )
θƤӽФϥͥ롦ХåեǤʤʤޤԤäơ
\fIlen\fP ХȤޤ \fIbuf\fP ؤɤ߽Фɤ߹
Хȿ֤ɤޤ줿ХȤϥХåեä:
ϰ٤ɤळȤǤʤ
ϥ桼Υץब
.IR /proc/kmsg
ɤ˥ͥˤäƼ¹ԤؿǤ⤢롣
.B syslog
.RI (3, buf , len )
θƤӽФϥХåեκǸ \fIlen\fP ХȤ
(˲Ū)ɤ߽ФǸΡ֥Хåեõ̿
(ϥХåեõ櫓Ǥʤ)
ʹߤ˥Хåե˽ޤ줿ʾɤ߹ळȤϤǤʤ
ɤ߹Хȿ֤
.B syslog
.RI (4, buf , len )
ƤӽФϡ֥Хåեõ̿¹Ԥʳ
ƱǤ롣
.B syslog
.RI (5, dummy , idummy )
ƤӽФϡ֥Хåեõ̿Τߤ¹Ԥ롣
.B ٥(loglevel)
.br
ͥ롦롼 \fIprintk\fP() Ϥ⤷줬
.I console_loglevel
ѿʲ loglevel ĤʤСˤΤߥå
ɽ롣(
.I console_loglevel
Ϻǽ DEFAULT_CONSOLE_LOGLEVEL (7)ꤵ뤬ư˥ͥ
ޥɡ饤ץ debug ꤵ줿ʤ 10 ꤵ롢
ͥ롦եȤȯˤ 15ꤵ롣- 10 15
̵̣ǡ8 )
ѿ
.B syslog
.RI (8, dummy , value )
ƤӽФˤä(1-8 ϰϤͤ)ꤹ롣
\fItype\fP 6 7 Ǥ
.B syslog
.RI ( type , dummy , idummy )
ƤӽФϡconsole_loglevel 줾 1(ͥ롦ѥ˥åΤ)
7(ǥХååʳ)ꤹ롣
åγƹԤΩΥ٥(loglevel)ġΥ٥
DEFAULT_MESSAGE_LOGLEVEL - 1 (6) Ĥ
Ԥ 1-7 ϰϤο \fId\fP ǻϤޤʤС٥ \fId\fP ġ
٥Ūʰ̣
.I <linux/kernel.h>
˰ʲΤ褦Ƥ:
.nf
#define KERN_EMERG "<0>" /* system is unusable */
#define KERN_ALERT "<1>" /* action must be taken immediately */
#define KERN_CRIT "<2>" /* critical conditions */
#define KERN_ERR "<3>" /* error conditions */
#define KERN_WARNING "<4>" /* warning conditions */
#define KERN_NOTICE "<5>" /* normal but significant condition */
#define KERN_INFO "<6>" /* informational */
#define KERN_DEBUG "<7>" /* debug-level messages */
.fi
.SH ֤
顼ξ \-1 ֤졢\fIerrno\fP ꤵ롣¾ξ硢
\fItype\fP 2, 3, 4 ʤɤ߹ХȿǤʤ 0 ֤
.SH 顼
.TP
.B EPERM
root θʤץ console_loglevelѹ褦Ȥ
ͥ롦åõ褦Ȥ
.TP
.B EINVAL
ѥδְ㤤
.TP
.B ERESTARTSYS
ɤޤʤ˥ʥˤäƥƥࡦ뤬ޤ줿
.SH
Υƥࡦ Linux ͭǤꡢܿտޤץǤ
ѤƤϤʤ
.SH Ϣ
.BR syslog (3)
|