[ ] [ ] [ ] [ トップページ ] [ 目次 ] [ Linuxの概要 ] [ 基本的な操作 ] [ 日本語の扱い ] [ テキスト編集 ] [ システム管理 ] [ シェルスクリプト ] [ インストール作業の基本 ] [ データベース ] [ 各種リファレンス ]  
[ スーパーユーザ ] [ シャットダウン ] [ ユーザ管理 ] [ アクセス権 ] [ ディスク ] [ デバイス ] [ TCP/IPとインタフェースの設定 ] [ 各種サーバの設定 ] [ プリンタの設定 ] [ ログ(実行記録) ] [ 起動時の動作 ] [ 設定用ユーティリティ ] [ バックアップ ] [ 稼動状況の調査 ]

ログ(実行記録)

ログの記録方法

アプリケーションやデーモンプログラムで発生したエラーなどの実行記録がログに記録される。
ログはプログラムが直接ログファイルに書き出すのではなく,syslogdというデーモンプログラムを通して,ログファイルに書き出される。
syslogdは他のマシンのsyslogdと連携して,ログを別のマシンに転送することができる。
侵入者は侵入を隠すためにログから侵入の記録を消すことがあるが,別のマシンに転送すればそうした改ざんがやりにくくなる。

syslogの設定

syslogは/etc/syslog.confファイルによって動作を設定する。

syslog.confの形式

<facility>.<priority>;<facility>.<level>;.....       <action>

facilityの種類

  • auth
  • auth-priv
  • cron
  • daemon
  • kern
  • lpr
  • mail
  • mark
  • news
  • syslog
  • user
  • uucp
  • local0からlocal7

priorityの種類(主要なもの)

  • debug
  • info
  • notice
  • warning
  • err
  • crit
  • alert
  • emerg

actionの種類

  • 通常のファイル
  • 名前付きパイプ
  • ターミナルとコンソール
  • リモートコンピュータ
  • ユーザ名のリスト
  • ログインしている誰でも

/etc/syslog.confの例

# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.*                                                 /dev/console

# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none                          /var/log/messages

# The authpriv file has restricted access.
authpriv.*                                              /var/log/secure

# Log all the mail messages in one place.
mail.*                                                  /var/log/maillog

# Everybody gets emergency messages, plus log them on another
# machine.
*.emerg                                                 *

# Save mail and news errors of level err and higher in a
# special file.
uucp,news.crit                                          /var/log/spooler
 

  
WB00806_.gif (471 バイト)
Copyright(C) 1997-1999 GlassCom
webmaster@glasscom.com