SlideShare a Scribd company logo
Syslog and log files 1-1
Syslog and Log Files
From logfiles, you can find
important information
History
Errors/warnings
Logging policies
Reset log files at periodic intervals
Rotate log file
Compress and archive
Throw away
Syslog and log files 1-2
Syslog and Log files
 Where are the log files?
 Random log names scattered across
dirs/filesystems
• Two common places:
– /var/adm
– /var/log
 To locate your log file:
• Read the man for individual daemons
• Read the system startup scripts
• Check syslog’s configuration file /etc/syslog.conf
Syslog and log files 1-3
Logs (see P 208 for more)
File program w
h
e
r
e
f
r
e
q
o
w
n
e
r
contents
messages various S M R Often the main system log file
syslog various S M R Often the main system log file
shutdownlog shutdow
n
S M R Reasons for shutdown
sulog su H M R Authorizations
wtmp/wtmpx login H M R Connect-time accounting
Httpd/*_log httpd F W R Web Server Logs
Acct kernel C D R SysV process accunting (binary)
Syslog and log files 1-4
Syslog
 Is a comprehensive logging system
 Manage the information generated by
• the kernel
• the system utilities
 Has two important function
• Liberate programmers
• Put administrators in control of logging
 Very flexible
• Sort message by source, importance
• Route the message to
– log file
– users’ terminals,
– Remote machines
• Thus, Centralize the logging for a network
Syslog and log files 1-5
Example
 Colossus
 /var/adm/messages
• Kernel.notice – ufs quota
• auth.error – sshd pentential probe of service
 /var/adm/sulog
 /var/log/syslog
 /var/log/authlog
 /var/log/dmesg
 /etc/syslog.conf
 Wopr.csl.mtu.edu
 /var/log/messages
• Lots of sshd messages
 /etc/syslog.conf
 Dafinn.cs.mtu.edu
 Where is httpd log file?
• /etc/init.d/httpd
• /etc/httpd/conf
– ServerRoot
– ErrorLog
– Symbolic links
 Where is print log file?
• /etc/init.d/cups
– /etc/cups/cupsd.conf
– /var/log/cups
Syslog and log files 1-6
Syslog
 Syslog consists of three parts
 The logging daemon:
• syslogd
• config file /etc/syslog.conf
 Library routines: openlog et al.
 User-level log submit command: logger
 Syslogd
 Is started at the boot time
 Write the messages
• Reads message from special file /dev/log (or others
depending on the system), then
• Consults with the configuration file, then
• Dispatches each message to the appropriate destination
Syslog and log files 1-7
Syslog
 Restart syslogd to
• make config change take effect
• truncate or rotate the log
 Send a HUP signal
# kill –HUP `/bin/cat /var/run/syslog.pid`
 Configuring syslogd
• /etc/syslog.conf controls syslogd’s behavior
• The basic format is
Selector <Tab> action
• Selectors identify the program and message’s
severity level with the format
Facility:level
• Facility, level must be kernel ware names
Syslog and log files 1-8
Syslog
• Valid facility names
– Kern
– User
– mail
– Daemon
– Auth
– Lpr
– Cron
– Syslog
– Mark
– local0-7
– ftp
– …
• Valid levels
(descending severity)
– emerg
– alert
– crit
– err
– warning
– notice
– info
– debug
– none
Syslog and log files 1-9
Syslog
• Selectors can be combined
– Separated by semicolon ;
– * to represent all facilities except mark
• Actions:
– Filename
– @hostname
– @ipaddress
– User1, user2, …
– *
• Example:
*.err;kern.debug;daemon.notice;mail.crit /var/adm/messages
kern.notice /var/log/kern.notice
*.alert;kern.err;daemon.err operator
*.alert root
Syslog and log files 1-10
Syslog
 central logging host
 Keep the log one place, easy to check.
 Need a stable server
• What if netloghost is down?
 The time stamp does not reflect the time on
the originating host
Syslog and log files 1-11
Using syslog from programs
 Functions
 Openlog
 Syslog
 Closelog
 C calls
void openlog(const char *ident, int option, int facility);
void syslog(int priority, const char *format, ...);
void closelog(void);
 Perl calls
Use Sys::Syslog;
Openlog(ident, logopt, facility)
Syslog(priority, message, …)
Closelog()
Syslog and log files 1-12
Logger
 Logger command
 Create a log entry
 Debug syslogd’s configuration file
• Example:
– After a new line was added to syslog.conf
Local5.warning /tmp/evi.log
– Run
$ logger –p local5.warning “test message”
– To see if “test message” is written in /tmp/evi.log
Syslog and log files 1-13
Log analyzer
 Get the related info out of lines
 Write up your own scripts
• Check for certain patterns
• Send email to you
 Commonly used log postprocessors
• Swatch
• Logcheck
 Couple of things to look for
 Security-related messages
 Disk full
 Messages that are repeated many times

More Related Content

PPT
Syslog.ppt
PDF
Trouble shoot with linux syslog
PPTX
PDF
Configuring Syslog by Octavio
PDF
Syslog Centralization Logging with Windows ~ A techXpress Guide
PPTX
INVESTIGATING UNIX SYSTEMS.pptx
PPTX
Syslog
PDF
Apache2 BootCamp : Logging and Monitoring
Syslog.ppt
Trouble shoot with linux syslog
Configuring Syslog by Octavio
Syslog Centralization Logging with Windows ~ A techXpress Guide
INVESTIGATING UNIX SYSTEMS.pptx
Syslog
Apache2 BootCamp : Logging and Monitoring

Similar to Syslog explained in detail in this presentation.ppt (20)

PPTX
Syslog
PDF
2015. Libre Software Meeting - syslog-ng: from log collection to processing a...
PPT
Comparison of Unix and Linux Log File Management Tools by Dusan Baljevic
ODP
Turbo charge your logs
PDF
LOADays 2015 - syslog-ng - from log collection to processing and infomation e...
PDF
Syslog Protocols
ODP
Turbo charge your logs
PDF
Regulatory compliance and system logging
PDF
Mastering JUNOS Syslog
PPT
CEE Logging Standard: Today and Tomorrow
PDF
linux.pdf
PPTX
Linux Presentation
PPT
Senior Capstone
PDF
SCaLE 2016 - syslog-ng: From Raw Data to Big Data
ODP
Rsyslog log normalization
ODP
Rsyslog vs Systemd Journal Presentation
PDF
Linux Tutorial with commands to use while learning
PPT
The importance of logs - DefCamp 2012
PPTX
LogChaos: Challenges and Opportunities of Security Log Standardization
PDF
Linux admin course
Syslog
2015. Libre Software Meeting - syslog-ng: from log collection to processing a...
Comparison of Unix and Linux Log File Management Tools by Dusan Baljevic
Turbo charge your logs
LOADays 2015 - syslog-ng - from log collection to processing and infomation e...
Syslog Protocols
Turbo charge your logs
Regulatory compliance and system logging
Mastering JUNOS Syslog
CEE Logging Standard: Today and Tomorrow
linux.pdf
Linux Presentation
Senior Capstone
SCaLE 2016 - syslog-ng: From Raw Data to Big Data
Rsyslog log normalization
Rsyslog vs Systemd Journal Presentation
Linux Tutorial with commands to use while learning
The importance of logs - DefCamp 2012
LogChaos: Challenges and Opportunities of Security Log Standardization
Linux admin course
Ad

Recently uploaded (20)

PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PPTX
communication and presentation skills 01
PPT
Total quality management ppt for engineering students
PPTX
Information Storage and Retrieval Techniques Unit III
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PDF
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
PDF
Visual Aids for Exploratory Data Analysis.pdf
PPT
A5_DistSysCh1.ppt_INTRODUCTION TO DISTRIBUTED SYSTEMS
PPT
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
PDF
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
PDF
86236642-Electric-Loco-Shed.pdf jfkduklg
PPT
Occupational Health and Safety Management System
PPTX
UNIT - 3 Total quality Management .pptx
PPTX
Nature of X-rays, X- Ray Equipment, Fluoroscopy
PPTX
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
PPTX
Artificial Intelligence
PDF
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
PDF
III.4.1.2_The_Space_Environment.p pdffdf
PDF
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
PDF
Analyzing Impact of Pakistan Economic Corridor on Import and Export in Pakist...
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
communication and presentation skills 01
Total quality management ppt for engineering students
Information Storage and Retrieval Techniques Unit III
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
Visual Aids for Exploratory Data Analysis.pdf
A5_DistSysCh1.ppt_INTRODUCTION TO DISTRIBUTED SYSTEMS
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
86236642-Electric-Loco-Shed.pdf jfkduklg
Occupational Health and Safety Management System
UNIT - 3 Total quality Management .pptx
Nature of X-rays, X- Ray Equipment, Fluoroscopy
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
Artificial Intelligence
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
III.4.1.2_The_Space_Environment.p pdffdf
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
Analyzing Impact of Pakistan Economic Corridor on Import and Export in Pakist...
Ad

Syslog explained in detail in this presentation.ppt

  • 1. Syslog and log files 1-1 Syslog and Log Files From logfiles, you can find important information History Errors/warnings Logging policies Reset log files at periodic intervals Rotate log file Compress and archive Throw away
  • 2. Syslog and log files 1-2 Syslog and Log files  Where are the log files?  Random log names scattered across dirs/filesystems • Two common places: – /var/adm – /var/log  To locate your log file: • Read the man for individual daemons • Read the system startup scripts • Check syslog’s configuration file /etc/syslog.conf
  • 3. Syslog and log files 1-3 Logs (see P 208 for more) File program w h e r e f r e q o w n e r contents messages various S M R Often the main system log file syslog various S M R Often the main system log file shutdownlog shutdow n S M R Reasons for shutdown sulog su H M R Authorizations wtmp/wtmpx login H M R Connect-time accounting Httpd/*_log httpd F W R Web Server Logs Acct kernel C D R SysV process accunting (binary)
  • 4. Syslog and log files 1-4 Syslog  Is a comprehensive logging system  Manage the information generated by • the kernel • the system utilities  Has two important function • Liberate programmers • Put administrators in control of logging  Very flexible • Sort message by source, importance • Route the message to – log file – users’ terminals, – Remote machines • Thus, Centralize the logging for a network
  • 5. Syslog and log files 1-5 Example  Colossus  /var/adm/messages • Kernel.notice – ufs quota • auth.error – sshd pentential probe of service  /var/adm/sulog  /var/log/syslog  /var/log/authlog  /var/log/dmesg  /etc/syslog.conf  Wopr.csl.mtu.edu  /var/log/messages • Lots of sshd messages  /etc/syslog.conf  Dafinn.cs.mtu.edu  Where is httpd log file? • /etc/init.d/httpd • /etc/httpd/conf – ServerRoot – ErrorLog – Symbolic links  Where is print log file? • /etc/init.d/cups – /etc/cups/cupsd.conf – /var/log/cups
  • 6. Syslog and log files 1-6 Syslog  Syslog consists of three parts  The logging daemon: • syslogd • config file /etc/syslog.conf  Library routines: openlog et al.  User-level log submit command: logger  Syslogd  Is started at the boot time  Write the messages • Reads message from special file /dev/log (or others depending on the system), then • Consults with the configuration file, then • Dispatches each message to the appropriate destination
  • 7. Syslog and log files 1-7 Syslog  Restart syslogd to • make config change take effect • truncate or rotate the log  Send a HUP signal # kill –HUP `/bin/cat /var/run/syslog.pid`  Configuring syslogd • /etc/syslog.conf controls syslogd’s behavior • The basic format is Selector <Tab> action • Selectors identify the program and message’s severity level with the format Facility:level • Facility, level must be kernel ware names
  • 8. Syslog and log files 1-8 Syslog • Valid facility names – Kern – User – mail – Daemon – Auth – Lpr – Cron – Syslog – Mark – local0-7 – ftp – … • Valid levels (descending severity) – emerg – alert – crit – err – warning – notice – info – debug – none
  • 9. Syslog and log files 1-9 Syslog • Selectors can be combined – Separated by semicolon ; – * to represent all facilities except mark • Actions: – Filename – @hostname – @ipaddress – User1, user2, … – * • Example: *.err;kern.debug;daemon.notice;mail.crit /var/adm/messages kern.notice /var/log/kern.notice *.alert;kern.err;daemon.err operator *.alert root
  • 10. Syslog and log files 1-10 Syslog  central logging host  Keep the log one place, easy to check.  Need a stable server • What if netloghost is down?  The time stamp does not reflect the time on the originating host
  • 11. Syslog and log files 1-11 Using syslog from programs  Functions  Openlog  Syslog  Closelog  C calls void openlog(const char *ident, int option, int facility); void syslog(int priority, const char *format, ...); void closelog(void);  Perl calls Use Sys::Syslog; Openlog(ident, logopt, facility) Syslog(priority, message, …) Closelog()
  • 12. Syslog and log files 1-12 Logger  Logger command  Create a log entry  Debug syslogd’s configuration file • Example: – After a new line was added to syslog.conf Local5.warning /tmp/evi.log – Run $ logger –p local5.warning “test message” – To see if “test message” is written in /tmp/evi.log
  • 13. Syslog and log files 1-13 Log analyzer  Get the related info out of lines  Write up your own scripts • Check for certain patterns • Send email to you  Commonly used log postprocessors • Swatch • Logcheck  Couple of things to look for  Security-related messages  Disk full  Messages that are repeated many times