Logi: erinevus redaktsioonide vahel

Allikas: Kuutõrvaja
Mine navigeerimisribaleMine otsikasti
Jj (arutelu | kaastöö)
Resümee puudub
Jj (arutelu | kaastöö)
Resümee puudub
23. rida: 23. rida:
Osa tarkvara ei kasuta logimiseks sysloq'i vaid eelistavad ise tegeleda logi kirjutamiega näit apache
Osa tarkvara ei kasuta logimiseks sysloq'i vaid eelistavad ise tegeleda logi kirjutamiega näit apache
nende tarkvaradega tuleb rohkem vaeva näha
nende tarkvaradega tuleb rohkem vaeva näha
Näiteks apachel
asendame rea
ErrorLog /var/log/httpd/error.log
reaga
ErrorLog syslog:local4
ja access log'i jaoks
CustomLog "|/usr/bin/logger -p local5.info" combined
syslog.conf muudatused tulevad
destination loghost { udp("193.40.0.35"); };
destination http_error { file("/var/log/httpd/error.log"); };
destination http_access { file("/var/log/httpd/access.log"); };
log { source(src); filter(f_local4); destination(loghost); };
log { source(src); filter(f_local4); destination(http_error); };
log { source(src); filter(f_local5); destination(loghost); };
log { source(src); filter(f_local5); destination(http_access); };





Redaktsioon: 11. juuni 2007, kell 10:43

sissejuhatus

logimist korraldab serveris tarkvara nimega syslog levinud on ka täiustatud logimootor nimega syslog-ng


logikliendi seadistus

syslog.conf'is näiteks kui on rida


auth,authpriv.*                 /var/log/auth.log


siis võib tekitada kõrvale


auth,authpriv.*                 @192.168.1.10


teenuste logimine läbi syslog'i

Osa tarkvara ei kasuta logimiseks sysloq'i vaid eelistavad ise tegeleda logi kirjutamiega näit apache nende tarkvaradega tuleb rohkem vaeva näha


Näiteks apachel

asendame rea

ErrorLog /var/log/httpd/error.log

reaga

ErrorLog syslog:local4

ja access log'i jaoks

CustomLog "|/usr/bin/logger -p local5.info" combined


syslog.conf muudatused tulevad


destination loghost { udp("193.40.0.35"); };

destination http_error { file("/var/log/httpd/error.log"); };
destination http_access { file("/var/log/httpd/access.log"); };

log { source(src); filter(f_local4); destination(loghost); };
log { source(src); filter(f_local4); destination(http_error); };
log { source(src); filter(f_local5); destination(loghost); };
log { source(src); filter(f_local5); destination(http_access); };


logiserveri seadistus

pärast syslog-ng installi lisame seadistusfailine näiteks sellise osa


source net {
        udp();
};


destination remote {
   file("/log/serverid/$FULLHOST/messages.log"
  owner(root) group(wheel) perm(0600) dir_perm(0700) create_dirs(yes));
};
 

destination remote_auth {
   file("/log/serverid/$FULLHOST/auth.log"
   owner(root) group(wheel) perm(0600) dir_perm(0700) create_dirs(yes));
};

destination remote_mail {
   file("/log/serverid/$FULLHOST/mail.log"
   owner(root) group(wheel) perm(0600) dir_perm(0700) create_dirs(yes));
};

destination remote_http_error {
   file("/log/serverid/$FULLHOST/http_error.log"
   owner(root) group(wheel) perm(0600) dir_perm(0700) create_dirs(yes));
};

destination remote_http_access {
   file("/log/serverid/$FULLHOST/http_access.log"
   owner(root) group(wheel) perm(0600) dir_perm(0700) create_dirs(yes));
}; 


destination swatch {
        program("/usr/local/bin/swatch --read-pipe=\"cat /dev/fd/0\"");
};