Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nRotate doesnt prevent new File for every day #24

Open
SirGamsay opened this issue Jun 19, 2024 · 0 comments
Open

nRotate doesnt prevent new File for every day #24

SirGamsay opened this issue Jun 19, 2024 · 0 comments

Comments

@SirGamsay
Copy link

Hey,
firstly thank you for you Library. For the most part it works great in my Project :)

However I do have an Issue with the nRotate Flag.

from the README

nRotate uint8_t 1 (enabled) Create new log file for each day.

So accordingly I did the following for my configuration:

slog_config_t cfg;
int nEnabledLevels = SLOG_FLAGS_ALL; 
const char *logFile = "/var/log/openvpn-client/application.log";
slog_init(logFile, nEnabledLevels, 0);
slog_config_get(&cfg);
cfg.nToFile = 1;
cfg.nToScreen = 1;  
cfg.sFilePath[0] = '/';
cfg.nIndent = 1;
cfg.nRotate = 0;        // Doesn't work
cfg.eColorFormat = SLOG_COLORING_DISABLE;   
slog_config_set(&cfg);
slog_debug("Test");

Which does produce

$ ls /var/log/openvpn-client/
application.log-2024-06-19.log ...

Even with the nRotate Flag set to 0, slog creates a new Log File for every Day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant