-
Notifications
You must be signed in to change notification settings - Fork 194
/
log2ram.conf
61 lines (50 loc) · 3.46 KB
/
log2ram.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Configuration file for Log2Ram (https://github.com/azlux/log2ram) under MIT license.
# This configuration file is read by the log2ram service
# Specify the amount of RAM reserved for storing logs. This setting determines the maximum size of the RAM folder.
# Ensure 'SIZE=' is set larger than the current size of your /var/log directory to prevent startup failures.
# Also, configure logrotate to manage log growth and prevent the /var/log directory from exceeding this reserved size.
# The default setting of 128M suffices for many typical applications, but you may need to increase it for
# servers or systems that generate extensive logging.
SIZE=128M
# Select the log syncing method between disk and RAM:
# - 'rsync' is the default unless 'USE_RSYNC' is set to 'false'.
# - If 'rsync' is unavailable, 'cp' is automatically used as a fallback.
# - Set 'USE_RSYNC' to 'false' to explicitly use 'cp'.
#USE_RSYNC=false
# By default, if there is insufficient RAM space, a system notification email is sent.
# Set this to 'false' to disable email notifications. (The error will still be logged locally).
#NOTIFICATION=true
# Specify the command for sending error notifications.
# By default, it uses the `mail` command to send an email, with the message body provided via stdin.
# You can replace this with any command (such as 'shoutrrr') or a custom script for handling notifications.
#NOTIFICATION_COMMAND=mail -s "Log2Ram Error on $HOSTNAME"
# Specify the directories to be stored in RAM. List each directory using its absolute path, e.g., `/path/folder`.
# Corresponding directories on the HDD, named `/path/hdd.folder`, will be automatically created for each listed path.
# Separate multiple paths with a semicolon `;` and do not include a trailing slash at the end of the paths.
# Example: PATH_DISK="/var/log;/home/test/FolderInRam"
PATH_DISK="/var/log"
# Set to 'true' to enable log rotation for journald logs before syncing.
# Note: 'rsync' must be used for this feature to work.
# Ensure 'SystemMaxUse' is configured in '/etc/systemd/journald.conf' (to limit journald’s disk usage)
# Note: Its value must be smaller than log2ram's RAM allocation defined by the SIZE variable above.
JOURNALD_AWARE=true
# **************** Zram backing conf ****************
# Set ZL2R=true to enable zram, providing compressed RAM storage for log2ram.
# Set ZL2R=false to use tmpfs, which provides uncompressed memory-only storage.
ZL2R=false
# Choose a compression algorithm from those listed in /proc/crypto.
# 'lz4' is the fastest, offering the lightest CPU load but lower compression ratios.
# 'deflate' (zlib) and 'Zstandard' (zstd) provide higher compression ratios but use more CPU.
# 'lzo' is similar to 'lz4' but may perform better with certain binaries due to optimizations.
# Set COMP_ALG to 'lz4' for speed, 'zstd' for better compression, or 'lzo' or 'zlib' if optimizations or availability are concerns.
COMP_ALG=lz4
# LOG_DISK_SIZE specifies the uncompressed zram disk size.
# (Sets the size of the zram disk that will be presented to the operating system).
# To estimate amount of RAM this will consume, divide LOG_DISK_SIZE by your chosen compression algorithm's ratio:
# - lzo/lz4 typically compresses at a ratio of 2.1:1
# - zlib compresses at about 2.7:1
# - zstandard (zstd) achieves around 2.9:1
# Example calculation using lz4:
# Given LOG_DISK_SIZE = 256M (which represents 256 Megabytes of uncompressed log data),
# the estimated zram RAM usage = 256 MB / 2.1 ≈ 122 MB of RAM.
LOG_DISK_SIZE=256M