[PR #1449] [MERGED] Added logfile option for non-syslog logging #1995

Closed
opened 2026-03-04 02:03:10 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/1449
Author: @ggtakec
Created: 10/13/2020
Status: Merged
Merged: 10/19/2020
Merged by: @gaul

Base: masterHead: add_logfile


📝 Commits (1)

  • c37a707 Added logfile option for non-syslog logging

📊 Changes

11 files changed (+426 additions, -136 deletions)

View changed files

📝 doc/man/s3fs.1 (+5 -0)
📝 src/Makefile.am (+1 -1)
📝 src/addhead.cpp (+1 -1)
📝 src/curl.cpp (+1 -1)
📝 src/s3fs.cpp (+24 -16)
📝 src/s3fs_help.cpp (+9 -0)
📝 src/s3fs_logger.cpp (+197 -3)
📝 src/s3fs_logger.h (+164 -91)
📝 src/sighandlers.cpp (+19 -19)
📝 src/sighandlers.h (+3 -3)
📝 src/test_string_util.cpp (+2 -1)

📄 Description

Relevant Issue (if applicable)

#1444

Details

Enabled to switch the log output to the specified file instead of syslog and stdout/stderr(when foreground).
To specify a log file, use the logfile option or the S3FS_LOGFILE environment.

The main changes are shown below:

  • Added logfile option
    Specify the log file name(path).
  • Added S3FS_LOGFILE environment variable
    Specify the log file name(path).
    If the logfile option is specified at the same time, the log file specified by the environment variable will be switched to the file specified by the logfile option after startup.(The logfile option takes precedence)
  • Added S3fsLog class
    The processing about logging has been consolidated into the S3fsLog class.
    Global variables have been changed to S3fsLog class variables.
    Some macros about logging are also aggregated into inline functions, and the macro name(function name) has changed.
  • Handled SIGHUP
    If specifed a log file, it will be reopened when it receives SIGHUP.
    This allows log rotation.

Note: test cases have not been created for log file switching and signals.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/s3fs-fuse/s3fs-fuse/pull/1449 **Author:** [@ggtakec](https://github.com/ggtakec) **Created:** 10/13/2020 **Status:** ✅ Merged **Merged:** 10/19/2020 **Merged by:** [@gaul](https://github.com/gaul) **Base:** `master` ← **Head:** `add_logfile` --- ### 📝 Commits (1) - [`c37a707`](https://github.com/s3fs-fuse/s3fs-fuse/commit/c37a707bcedd2a4f8ce6e2a192bc503623e66344) Added logfile option for non-syslog logging ### 📊 Changes **11 files changed** (+426 additions, -136 deletions) <details> <summary>View changed files</summary> 📝 `doc/man/s3fs.1` (+5 -0) 📝 `src/Makefile.am` (+1 -1) 📝 `src/addhead.cpp` (+1 -1) 📝 `src/curl.cpp` (+1 -1) 📝 `src/s3fs.cpp` (+24 -16) 📝 `src/s3fs_help.cpp` (+9 -0) 📝 `src/s3fs_logger.cpp` (+197 -3) 📝 `src/s3fs_logger.h` (+164 -91) 📝 `src/sighandlers.cpp` (+19 -19) 📝 `src/sighandlers.h` (+3 -3) 📝 `src/test_string_util.cpp` (+2 -1) </details> ### 📄 Description ### Relevant Issue (if applicable) #1444 ### Details Enabled to switch the log output to the specified file instead of syslog and stdout/stderr(when foreground). To specify a log file, use the logfile option or the S3FS_LOGFILE environment. The main changes are shown below: - Added `logfile` option Specify the log file name(path). - Added `S3FS_LOGFILE` environment variable Specify the log file name(path). If the logfile option is specified at the same time, the log file specified by the environment variable will be switched to the file specified by the `logfile` option after startup.(The `logfile` option takes precedence) - Added `S3fsLog` class The processing about logging has been consolidated into the `S3fsLog` class. Global variables have been changed to `S3fsLog` class variables. Some macros about logging are also aggregated into inline functions, and the macro name(function name) has changed. - Handled `SIGHUP` If specifed a log file, it will be reopened when it receives SIGHUP. This allows log rotation. _Note: test cases have not been created for log file switching and signals._ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 02:03:10 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#1995
No description provided.