Projects
Eulaceura:Mainline:GA
oeAware-manager
_service:obs_scm:0001-plugin_mgr-logger-apppend...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:0001-plugin_mgr-logger-apppend-to-logfile-rather-than-tru.patch of Package oeAware-manager
From 54c5b50eb19467d32d83a85478f468dff52b69e6 Mon Sep 17 00:00:00 2001 From: Zhao Mengmeng <zhaomengmeng@kylinos.cn> Date: Thu, 27 Jun 2024 13:45:00 +0800 Subject: [PATCH 1/4] plugin_mgr: logger: apppend to logfile rather than truncate In log4cplus, the default openmode for Class FileAppender is std::ios_base::trunc, which cause the log file be cleared after each `systemctl restart oeaware.service`. Fix this by setting openmode to std::ios_base::app. --- src/plugin_mgr/logger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugin_mgr/logger.cpp b/src/plugin_mgr/logger.cpp index af39583..378075c 100644 --- a/src/plugin_mgr/logger.cpp +++ b/src/plugin_mgr/logger.cpp @@ -27,7 +27,7 @@ Logger::Logger() { } void Logger::init(std::shared_ptr<Config> config) { - log4cplus::SharedAppenderPtr appender(new log4cplus::FileAppender(config->get_log_path() + "/server.log")); + log4cplus::SharedAppenderPtr appender(new log4cplus::FileAppender(config->get_log_path() + "/server.log", std::ios_base::app)); appender->setName("file"); log4cplus::tstring pattern = LOG4CPLUS_TEXT("%D{%m/%d/%y %H:%M:%S} [%t] %-5p %c - %m" #ifdef OEAWARE_DEBUG -- 2.33.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2