Questions tagged [log-files]

A log file is a file, often in clear text, which is generated by a software process to record some specific details about the workings of this process.

A log file is a file which is generated by a software process to record some specific details (events) about the workings of this process. Most logfiles are plain, human-readable text files, some however are using a binary format to conserve space and need specific treatment for post-processing. (Example: Unix login history in utmp/wtmp format)

A log file can be categorized into several types:

  1. Access log which records information related to the usage of the service provided by this process.
  2. Error log which records error conditions.
  3. Info/Debug log which records more detailed information as compared with other logs.
  4. Transaction log to document a chain of events, this often is required to be immutable to avoid later tampering.
  5. redo logs, containing the complete information to replay a chain of actions, often used where incomplete data transactions would lead to inconsistent data, for example in file systems or databases.

The main two goals of creating and maintaining log files are:

  1. Finding and debugging problems.
  2. Gathering usage information.

Depending on the frequence of events and the level of detail, logfiles may be growing very quickly, and usually require a strategy for managing their growth.

Depending on special reqirements, log-files may go to specialized devices to meet criteria of speed or immutability.

1103 questions
31
votes
8 answers

Can cron write job output to a log *by default* (instead of mail)?

We all know the right way to handle output from cron jobs is to redirect it to a file: 0 * * * * /bin/date >> /var/log/date.log 2>&1 However, sometimes admins are lazy, forgetful, or ignorant and don't put in those redirects; in this case the output…
Brad
  • 412
  • 1
  • 4
  • 7
31
votes
6 answers

Linux server out of space

I have been asked this question in two consecutive interviews, but after some research and checking with various systems administrators I haven't received a good answer. I am wondering if somebody can help me out here. A server is out of disk space.…
Abhijeet Jahagirdar
30
votes
10 answers

Convenient Windows equivalent to tail -f logfile?

Is there some convenient alternative to this on Windows? I always miss this away from Linux. And no I don't consider Cygwin or some other bash port to be "convenient". :) Either a small app that'll do it from the command line or will have it open in…
cletus
  • 9,999
  • 9
  • 37
  • 40
29
votes
2 answers

Who restarted my Windows server?

Is it possible on Windows Server 2000/2003/2008 machines to see which user rebooted the server? I have found the shutdown event in the System event log, but it does not show which user initiated the reboot.
joar
  • 911
  • 1
  • 8
  • 13
28
votes
2 answers

How to forward specific log file outside of /var/log with rsyslog to remote server?

How can I forward message from a specific log file like /www/myapp/log/test.log with rsyslog client to remote rsyslog server? This log file is outside of the directory /var/log.
Kevin Campion
  • 437
  • 2
  • 7
  • 15
28
votes
6 answers

Preferred format of file names which include a timestamp

As we all know "unix" can have anything in a file except '/' and '\0', sysadmins however tend to have a much smaller preference, mainly due to nothing liking spaces as input ... and a bunch of things having a special meaning for ':' and '@' among…
James Antill
  • 751
  • 1
  • 5
  • 10
26
votes
3 answers

what is sensible-mda and do i need it?

I'm running Ubuntu Intrepid, and have been seeing the following my logs: Aug 23 16:01:03 wp1 sm-mta[13700]: n7NFJIad013566: Warning: program /usr/sbin/sensible-mda unsafe: No such file or directory Aug 23 16:01:03 wp1 sm-mta[13700]: n7NFJIad013566:…
FilmJ
  • 766
  • 2
  • 9
  • 16
24
votes
7 answers

Continuously monitor logs with tail that are occasionally rotated

We're using tail to continuously monitor several logs, but when a log is rotated the tail for that file will cease. As far as I understand, the problem is that when the log is rotated, there is a new file created, and the running tail process…
xkcd150
  • 928
  • 1
  • 7
  • 11
22
votes
12 answers

Viewing logs on a remote linux server

Are there any nice tools for doing a 'tail -f' on a remote (linux) server? It would be nice to be able to do something like "taillog server_host /var/log/syslog" to view logs on various servers without having to ssh in. How about an app that shows…
readonly
  • 3,359
  • 4
  • 26
  • 23
22
votes
1 answer

overriding nginx access_log directive - duplicate log entries

I'm using the default nginx package on Ubuntu 14.04 server. It is using /etc/nginx/nginx.conf as the main config, and then includes configs from /etc/nginx/conf.d/*.conf and /etc/nginx/sites-enabled/*. The default nginx config has this directive for…
Yoav Aner
  • 561
  • 2
  • 6
  • 13
22
votes
5 answers

Logrotate: Rotating non-log files?

I have a backup script that compresses various files and directories and creates .tgz archives. Files are named, e.g. ... backup_2010-10-28.tar.gz backup_2010-10-29.tar.gz backup_2010-10-30.tar.gz backup_2010-10-31.tar.gz backup_2010-11-01.tar.gz I…
jen
  • 223
  • 1
  • 2
  • 5
20
votes
6 answers

Is this server hacked or just login attempts ? See log

Can someone tell what does this mean? I tried a command like lastb to see last user logins and I see some strange logins from China (server is EU, I am in EU). I was wondering if these could be login attempts or successfull logins? These seem to be…
adrianTNT
  • 1,077
  • 6
  • 22
  • 43
20
votes
7 answers

Command line tools to analyze Apache log files

I have a bunch of Apache log files that I would like to analyze. I'm looking for a tool that doesn't require much setup; something that I can run a log through the command line, without messing around on our live web servers. Any recommendations?
mmattax
  • 1,304
  • 7
  • 19
  • 30
19
votes
2 answers

Where is ASP.NET server log file is located?

My ASP.NET MVC application on my development box is running wild; I can't even connected to localhost. In order to know what is the problem, I want to find the log file and examine it. Where is the location of the ASP.NET Server log file? I couldn't…
Graviton
  • 2,865
  • 12
  • 42
  • 64
19
votes
1 answer

Linux: How to enforce specific permissions on newly created logs which are created by log rotate?

I've noticed that the mail logs which are being created in /var/log are being created and owned by root (user and group). I've written a Nagios check which monitors the log and in order to allow the Nagios user to access it, I gave the other group…
Itai Ganot
  • 10,644
  • 29
  • 93
  • 146
1
2
3
73 74