Linux Log Planning

Updated date: 2024-10-05


Linux (Ubuntu)

Create perssitent log location

$ sudo lsblk
...
nvme0n1                   259:0    0 931.5G  0 disk
├─nvme0n1p1               259:1    0     1G  0 part /boot/efi
├─nvme0n1p2               259:2    0     2G  0 part /boot
└─nvme0n1p3               259:3    0 928.5G  0 part
  └─ubuntu--vg-ubuntu--lv 253:0    0 514.2G  0 lvm  /
...
$ sudo lvcreate --name log-data -L 20G ubuntu-vg
$ sudo mkfs.ext4 /dev/ubuntu-vg/log-data

Log list

Under /var/log directory, there are several logs that are generated by the system. The following logs are generated by default:

Define what log should be stored and monitored

Logrotate