summaryrefslogtreecommitdiff
path: root/src/daemon/dlt-daemon.h
diff options
context:
space:
mode:
authorDaniel Weber <37300320+danielweber2018@users.noreply.github.com>2023-03-10 15:31:48 +0100
committerGitHub <noreply@github.com>2023-03-10 15:31:48 +0100
commit363d433a5dac141020cef4f698f60644fe4a202c (patch)
tree6d21d2447309ca9e4a76fb3c70d36b216d1ef753 /src/daemon/dlt-daemon.h
parent3b8a82ffae22c51bb02c11e669754983e8aabd5a (diff)
downloadDLT-daemon-363d433a5dac141020cef4f698f60644fe4a202c.tar.gz
logfile: exhance internal dlt logging by introducing size limits (#369)
Enhance dlt logging such that multiple files are used as it is done for the offline traces. Add limit-specific config values for logging. For this purpose the pattern of index-based file names is used only. This approach of logging to multiple files and rotating in order to keep the limits ensures that dlt logs take care of available space on the underlying file system and do not grow infinitely. Signed-off-by: Daniel Weber <daniel.w.weber@daimler.com> Co-authored-by: Oleg Tropmann <oleg.tropmann@daimler.com>
Diffstat (limited to 'src/daemon/dlt-daemon.h')
-rw-r--r--src/daemon/dlt-daemon.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/daemon/dlt-daemon.h b/src/daemon/dlt-daemon.h
index 071562f..cc879cb 100644
--- a/src/daemon/dlt-daemon.h
+++ b/src/daemon/dlt-daemon.h
@@ -69,6 +69,7 @@
#include <limits.h> /* for NAME_MAX */
#include <sys/time.h>
+#include <stdarg.h>
#include "dlt_daemon_common.h"
#include "dlt_user_shared.h"
@@ -103,10 +104,13 @@ typedef struct
char offlineTraceDirectory[DLT_DAEMON_FLAG_MAX]; /**< (String: Directory) Store DLT messages to local directory (Default: /etc/dlt.conf) */
int offlineTraceFileSize; /**< (int) Maximum size in bytes of one trace file (Default: 1000000) */
int offlineTraceMaxSize; /**< (int) Maximum size of all trace files (Default: 4000000) */
- int offlineTraceFilenameTimestampBased; /**< (int) timestamp based or index based (Default: 1 Timestamp based) */
- int loggingMode; /**< (int) The logging console for internal logging of dlt-daemon (Default: 0) */
+ bool offlineTraceFilenameTimestampBased; /**< (Boolean) timestamp based or index based (Default: true=Timestamp based) */
+ DltLoggingMode loggingMode; /**< (int) The logging console for internal logging of dlt-daemon (Default: 0) */
int loggingLevel; /**< (int) The logging level for internal logging of dlt-daemon (Default: 6) */
char loggingFilename[DLT_DAEMON_FLAG_MAX]; /**< (String: Filename) The logging filename if internal logging mode is log to file (Default: /tmp/log) */
+ bool enableLoggingFileLimit; /**< (Boolean) Indicate whether size of logging file(s) is limited (Default: false) */
+ int loggingFileSize; /**< (int) Maximum size in bytes of one logging file (Default: 250000) */
+ int loggingFileMaxSize; /**< (int) Maximum size in bytes of all logging files (Default: 1000000) */
int sendECUSoftwareVersion; /**< (Boolean) Send ECU software version perdiodically */
char pathToECUSoftwareVersion[DLT_DAEMON_FLAG_MAX]; /**< (String: Filename) The file from which to read the ECU version from. */
int sendTimezone; /**< (Boolean) Send Timezone perdiodically */
@@ -154,7 +158,8 @@ typedef struct
DltShm dlt_shm; /**< Shared memory handling */
unsigned char *recv_buf_shm; /**< buffer for receive message from shm */
#endif
- DltOfflineTrace offlineTrace; /**< Offline trace handling */
+ MultipleFilesRingBuffer offlineTrace; /**< Offline trace handling */
+ MultipleFilesRingBuffer dltLogging; /**< Dlt logging handling */
int timeoutOnSend;
unsigned long RingbufferMinSize;
unsigned long RingbufferMaxSize;