Store log files appended by a running service in the standard FHS hierarchy.
Which directory is appropriate?
/var/log stores log files and directories as variable data that grows during operation.
Detailed explanation
/var/logCorrect. /var/log is the standard log hierarchy.
/etcIncorrect. /etc is for configuration.
/usr/shareIncorrect. /usr/share stores shareable static data.
/bootIncorrect. /boot contains boot-related files.
Try it yourself
An example you can run in a temporary verification environment.
test -d /var/log && printf '/var/log exists\n'Expected result
/var/log existsKey points
- /var is variable data
- /var/log is for logs
- Configuration belongs in /etc
Notes
- Environment: FHS準拠Linux / ディレクトリ存在確認のみ
- Use read-only lookups or disposable paths when verifying search behavior.
- Distribution-specific defaults should be checked before changing system configuration.
Foundation review
Place the operation
Logs are operational records and should be separated from static configuration and shared program data.
Check the side effect
Plan permissions, retention, rotation, and capacity monitoring together with the path choice.