/var/log/messages 에 저장하는 것은 syslog()함수인가 syslogd 데몬인가?

Iinux의 이미지

/var/log/messages 에 저장하는 것은 syslog()함수인가 syslogd 데몬인가?

============================================================
$ man syslog

syslog() generates a log message, which will be distributed by syslogd(8). The priority argument is formed by ORing the facility and the
level values (explained below). The remaining arguments are a format, as in printf(3) and any arguments required by the format, except
that the two character sequence %m will be replaced by the error message string strerror(errno). A trailing newline may be added if
needed.

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

syslog 맨페이지 보면 " syslog()는 로그 메시지를 생성하고.... syslogd는 이것을 분배할 것이다 " 라고 하고 있습니다.

보통 /var/log/messages 에 저장이 되잔아요...
syslog() 함수가 /var/log/messages 에 저장하는 것인가요? 아니면.. syslogd가 /var/log/messages에 저장되는 것인가요?

syslogd에서 -O FILE 옵션을 통해서 /var/log/messages 위치를 바꿀수 있다고 나오는데
그렇다면 syslog() 함수가 /var/log/messages 라는 위치에 기록하도록 하드코딩되어 있는 것이 아니라는 뜻인데..
syslog() 함수는 메시지를 생성해서 어디에 저장하는 것인가요?

(BusyBox v1.7.2 )
$ syslogd --help

Options:
-n Run as foreground process
-O FILE Log to given file (default=/var/log/messages)
-l n Set local log level
-S Smaller logging output
-s SIZE Max size (KB) before rotate (default=200KB, 0=off)
-b NUM Number of rotated logs to keep (default=1, max=99, 0=purge)
-R HOST[:PORT] Log to IP or hostname on PORT (default PORT=514/UDP)
-L Log locally and via network (default is network only if -R)
-C[size(KiB)] Log to shared mem buffer (read it using logread)

mithrandir의 이미지

syslog()는 /dev/log domain socket에 메시지를 보냅니다.
syslogd류는 저 위치에 listen socket을 열어둡니다.

언제나 삽질 - http://tisphie.net/typo/
프로그래밍 언어 개발 - http://langdev.net

언제나 삽질 - http://tisphie.net/typo/
프로그래밍 언어 개발 - http://langdev.net

Iinux의 이미지

=====================
그런것이었군요...

감사합니다. 딱 이해가 되네요

그런데.. 님은 그걸 어디서 읽으셨나요?

저도 꽤 구글링 했는데 안나오더라구요

리눅스로 밥먹고 산지 10년이 되었건만.. 아직도 그걸 모르네요

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

mithrandir의 이미지

syslog가 돌아가는 원리를 봐야할 일이 있어서(뭐였는지는 기억이 안납니다)
좀 찾아봤던적이 있습니다. 원래는 커널로 보내나 했었죠.

그때는 아마 glibc의 syslog 함수를 직접 열어봤던 것 같습니다.

그 밖에 syslogd(8) 에 /dev/log가 간단히 언급되어 있습니다.

사실 답 쓰기전에 표준같은게 정의되어있나 좀 찾아봤는데, 안나왔더랬지요.

언제나 삽질 - http://tisphie.net/typo/
프로그래밍 언어 개발 - http://langdev.net

언제나 삽질 - http://tisphie.net/typo/
프로그래밍 언어 개발 - http://langdev.net

eou4의 이미지

저도 궁금했는데.. 감사합니다.

ㅎㅁㅎ

ㅎㅁㅎ

익명 사용자의 이미지

감사합니다
좋은정보 얻었네요

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.