Questions tagged [logs]

Configuring or analysing log files (text files where programs output error and informational messages, useful for debugging and troubleshooting).

1962 questions
181
votes
1 answer

How to clean log file?

Is there a better way to clean the log file? I usually delete the old logfile and create a new logfile and I am looking for a shorter type/bash/command program. How can I use an alias?
Micromega
  • 4,211
16
votes
4 answers

Debian - auth.log missing from /var/log

I am learning Debian on RaspberryPI. I've installed 'logwatch' and 'fail2ban' recently and those two were working Great! A few days ago I've spotted that I don't have a file "auth.log" but I do have "auth.log.gz1" etc. (so archive data) I've used…
Adam
  • 161
  • 1
  • 1
  • 4
14
votes
3 answers

why the second log files on /var/log are not compressed

the logs on /var/log/ (Debian/Ubuntu) are stored as x.log x.log.1 x.log.2.gz ... like kernel logs, syslogs, etc. I see that as the log info increases, they are stored by splitting into smaller files (rather than keeping all in a single file). I…
Angs
  • 502
  • 2
  • 7
  • 21
8
votes
2 answers

How to atomically change / rotate log file every minute?

I've got a legacy app that is generating a huge lot of logs message. I'd like to be able to rotate the file every minute (or so) but without loosing / truncating any message. The app is not able to change of file by itself so I need to do it…
Cerber
  • 235
7
votes
5 answers

Why are there so many log files in a typical Linux system? Why don't they use one consolidated logs db/file and an api?

I just wonder why are there so many log files in a typical Linux system? Wouldn't it be a better idea to have one system api function for logging and one consolidated table to save all the log entries from all the applications?
Ivan
  • 17,708
5
votes
1 answer

Why are there nulls in /var/log/kern.log?

I am experiencing a problem with Ubuntu 16.04 installed on an SSD. kern.log includes messages such as: ata3: SError: { UnrecovData 10B8B BadCRC } which I believe indicates a potential hardware fault. But kern.log also ends with 1225 null bytes.…
jl6
  • 1,455
  • 2
  • 14
  • 29
5
votes
2 answers

Log analysis software

In order to learn more about what is logged by my desktop machine, I'd like to set up something better than a casual grep command to see what's going on. A typical use case would be to send an email with a warning if more than X SSH login attempts…
l0b0
  • 51,350
4
votes
3 answers

How to log all things that happened via an SSH session?

Question: on an ex.: Linux or AIX machine, how can we log the things that happened via ssh? ex.: a user logged in, gaved out a few commands, or an automated tool executed something via ssh or someone simply issued a "ssh root@server commandhere"…
4
votes
1 answer

Keepalived - is it possible to change log file directory?

I'm wondering if is there any way to change log directory for keepalived daemon. I couldn't find any answer on my question. Maybe it's possible using tools like syslog, rsyslog? The reason why I'm asking is that I need to run keepalived as user with…
widget
  • 71
3
votes
1 answer

How to read ptpd-stats.log

Here is a line from ptpd-stats.log 2018-04-12 15:22:30.028085, slv, 000efefffe010e5a(unknown)/1, 0.000033858, -0.000008460, 0.000034260, 0.000013035, -16399.833000000, S, 0.000033809, 51, 0.000001184, 6355, -16384, 15, 0.000013035, …
3
votes
0 answers

Logstash: Handshake failed i/o timeout

I have a problem between logstash-forward and logstash, i have installed correctly the SSL certificate but i have this error: Failed to tls handshake with 111.111.111.111 read tcp 111.111.111.111:5000: i/o timeout If i check SSL with openssl…
stecog
  • 2,271
3
votes
3 answers

Redirect program output to file with line number limit

Is it possible to redirect program output to file, but with maximum lines limit, for example 4 lines limit: ./program | save 4 out.txt The ./program will continue giving output (maybe one line or more) every few seconds, but only 4 most recent/last…
Kokizzu
  • 9,699
2
votes
0 answers

Tail one logfile in multiple windows based on regex

I have a single logfile that contains logs for a threaded application. Each thread writes its own name onto the lines they emit: 16.04.2021 10:10:04 - Thread-1 - DEBUG - I did something 16.04.2021 10:10:04 - Thread-2 - DEBUG - I too did…
kiesel
  • 21
2
votes
1 answer

Apache Log file - Referer URL that doesn't exist

After recently having my shared-host linux server hacked (~25 WordPress installs, malicious code spidered throughout), I've started looking through my access log files to see where my traffic is coming from (was hoping to narrow down the point of…
DACrosby
  • 121
2
votes
1 answer

How do I set up and manually trigger log rotation?

I have a web server which I have clearly not set up properly. One of the users (which webmin makes the owner of most of the sites) has 15G log files (even after the backup copies were removed). I am aware that these log files should be rotated but…
1
2 3 4