Configuring or analysing log files (text files where programs output error and informational messages, useful for debugging and troubleshooting).
Questions tagged [logs]
2008 questions
1088
votes
7 answers
How to see full log from systemctl status service?
I check service status with systemctl status service-name . By default, I see few rows only, so I add -n50 to see more. Sometimes, I want to see full log, from start. It could have 1000s of rows. Now, I check it with -n10000 but that doesn't look…
10robinho
- 11,279
332
votes
2 answers
View stdout/stderr of systemd service
I have created a simple systemd service file for a custom application. The application works well when I run it manually, but my CPU gets maxed out when I run it with systemd. I'm trying do track down where my problem is, but I don't know where to…
beatgammit
- 7,903
250
votes
11 answers
Where are cron errors logged?
If I setup cron jobs incorrectly they appear to silently fail. Where should I look for an error log to understand what went wrong?
Brian Lyttle
- 2,761
- 3
- 18
- 9
244
votes
7 answers
How can I see dmesg output as it changes?
I'm writing a device driver that prints error message into ring buffer dmesg output. I want to see the output of dmesg as it changes. How can I do this?
Milad Khajavi
- 3,327
211
votes
4 answers
Where are Apache file access logs stored?
Does anyone know where file access logs are stored, so I can run a tail -f command in order to see who is accessing a particular file. I have XAMPP, which is an Apache server installed on my machine, which automatically logs the accesses. It is…
AkshaiShah
- 3,679
208
votes
12 answers
How to find out from the logs what caused system shutdown?
E.g. I'm seeing this in /var/log/messages : Mar 01 23:12:34 hostname shutdown: shutting down for system halt Is there a way to find out what caused the shutdown? E.g. was it run from console, or someone hit power button, etc.?
alex
- 7,583
182
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?
Cybercartel
- 4,221
173
votes
4 answers
Find and remove large files that are open but have been deleted
How does one find large files that have been deleted but are still open in an application? How can one remove such a file, even though a process has it open? The situation is that we are running a process that is filling up a log file at a terrific…
dotancohen
- 16,663
153
votes
6 answers
How to monitor only the last n lines of a log file?
I have a growing log file for which I want to display only the last 15 lines. Here is what I know I can do: tail -n 15 -F mylogfile.txt As the log file is filled, tail appends the last lines to the display. I am looking for a solution that only…
Marc-Olivier Titeux
- 1,663
147
votes
1 answer
How to do a `tail -f` of log rotated files?
On a long running system I usually have a terminal with $ tail -f /var/log/kern.log or something like this open. But from time to time I have to restart such command because no new messages are displayed anymore. I assume this is because of the log…
maxschlepzig
- 60,332
116
votes
4 answers
what is the CentOS equivalent of /var/log/syslog (on Ubuntu)?
On ubuntu this file exists: /var/log/syslog . However the same file does not appear on CentOS Distributions. What is the equivalent file on CentOS?
brakertech
- 1,415
115
votes
3 answers
grep inside less?
I'm currently sifting through a lot of unfamiliar logs looking for some issues. The first file I look at is Events.log, and I get at least three pages in less which appear to display the same event at different times – an event that appears to be…
forquare
- 3,576
109
votes
13 answers
Meaning of “Connection closed by xxx [preauth]” in sshd logs
We have a Windows batch script, which connects automatically to a linux server via PLINK (putty). There is NO public private key authentication, the user and the password are in the script. On our linux server we have several sshd log entries…
Wolfgang Adamec
- 1,503
106
votes
5 answers
Where are my sshd logs?
I can't find my sshd logs in the standard places. What I've tried: Not in /var/log/auth.log Not in /var/log/secure Did a system search for 'auth.log' and found nothing I've set /etc/ssh/sshd_config to explicitly use SyslogFacility AUTH and LogLevel…
HXCaine
- 1,287
99
votes
9 answers
Logging SSH access attempts
I've configured an ubuntu server with openssh in order to connect to it and execute commands from a remote system like a phone or a laptop. The problem is... I'm probably not the only one. Is there a way to know all the login attempts that have been…
UserK
- 2,614