Log messages and journal logs Flashcards

1
Q

Traditional logs location, for example rsyslog etc

A

/var/log

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Man for systemd logs

A

man systemd-journald

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Location of journalctl logs

Make journalctl logs written permanently

A

/run/log/journal

/var/log/journal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Config location of systemd-journald

A

/etc/systemd/journald.conf

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Show last 10 lines of jounalctl

A

journalctl -n

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Show last extended logs of jounalctl

A

journalctl -xe

  • e- go to the end
  • x- explanation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Show last 10 line with jouranlctl and continue listening

A

journalctl -f

-f -follow

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Show logs for specific unit

A

journalctl -u httpd.service

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Show logs of ring buffer

A

journalctl -k

dmesg

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Location of configs related to log rotation

A

/etc/logrotate.d/file_name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Remote logging

A

Rsyslog is used for forwarding log messages in an IP network.
The main configuration file for rsyslog is /etc/rsyslog.conf. Here, you can specify global directives, modules, and rules that consist of filter and action parts.
__
vim /etc/rsyslog.d/my_file.conf
. @1.2.3.4:514 (send all logs from this pc to 1.2.3.4)
1.2.3.4 should be configured to accept requests on 514
@-udp
@@-tcp

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Query to systemd journal

A

journalctl [opt] [match]
journalctl -f -o verbose (o=output: short, verbose,json etc)
journalctl -p err (p=priority: err, crit,alert,emerg, notice,warning)
journalct -u ssh (u=unit)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Query to systemd journal since/until

A

journalctl –since=yesterday –until=now

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Info about how much time boot process took

A

systemd-analyze : shot info

systemd-analyze blame : long info

How well did you know this?
1
Not at all
2
3
4
5
Perfectly