Skip to content

Commit

Permalink
extend documentation for use of Ditto log file feature;
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Maute <stefan.maute@bosch.io>
  • Loading branch information
Stefan Maute committed Mar 2, 2022
1 parent 8e0aab4 commit aa6221c
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 16 deletions.
8 changes: 5 additions & 3 deletions concierge/service/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@
<level>info</level>
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- daily rollover as default-->
<fileNamePattern>${DITTO_LOGGING_FILE_NAME_PATTERN:-/var/log/ditto/concierge.log.%d{yyyy-MM-dd}.gz}</fileNamePattern>
<!-- The rollover period is inferred from the fileNamePattern -->
<!-- daily rollover as default -->
<fileNamePattern>${DITTO_LOGGING_FILE_NAME_PATTERN:-/var/log/ditto/concierge.log.%d{yyyy-MM}.gz}</fileNamePattern>
<!-- Keep 10 days' worth of history capped at 1GB total size as default -->
<maxHistory>${DITTO_LOGGING_MAX_LOG_FILE_HISTORY_IN_DAYS:-10}</maxHistory>
<!-- maxHistory is based on the rollover period of the fileNamePattern -->
<maxHistory>${DITTO_LOGGING_MAX_LOG_FILE_HISTORY:-10}</maxHistory>
<totalSizeCap>${DITTO_LOGGING_TOTAL_LOG_FILE_SIZE:-1GB}</totalSizeCap>
<cleanHistoryOnStart>${DITTO_LOGGING_CLEAN_HISTORY_ON_START:-false}</cleanHistoryOnStart>
</rollingPolicy>
Expand Down
4 changes: 3 additions & 1 deletion connectivity/service/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@
<level>info</level>
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- The rollover period is inferred from the fileNamePattern -->
<!-- daily rollover as default -->
<fileNamePattern>${DITTO_LOGGING_FILE_NAME_PATTERN:-/var/log/ditto/connectivity.log.%d{yyyy-MM-dd}.gz}</fileNamePattern>
<!-- Keep 10 days' worth of history capped at 1GB total size as default -->
<maxHistory>${DITTO_LOGGING_MAX_LOG_FILE_HISTORY_IN_DAYS:-10}</maxHistory>
<!-- maxHistory is based on the rollover period of the fileNamePattern -->
<maxHistory>${DITTO_LOGGING_MAX_LOG_FILE_HISTORY:-10}</maxHistory>
<totalSizeCap>${DITTO_LOGGING_TOTAL_LOG_FILE_SIZE:-1GB}</totalSizeCap>
<cleanHistoryOnStart>${DITTO_LOGGING_CLEAN_HISTORY_ON_START:-false}</cleanHistoryOnStart>
</rollingPolicy>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,10 @@ Gathering logs for a running Ditto installation can be achieved by:
* writing logs to log files: this can be done by setting the environment variable `DITTO_LOGGING_FILE_APPENDER` to `true`
* configure the amount of log files, and the total amount of space used for logs files via these environment
variables. It is also possible to clean up old log files and archives at start up.
In case `DITTO_LOGGING_TOTAL_LOG_FILE_SIZE` is used it is necessary to configure also `DITTO_LOGGING_MAX_LOG_FILE_HISTORY_IN_DAYS`.
* `DITTO_LOGGING_FILE_NAME_PATTERN` (default: /var/log/ditto/<service-name>.log.%d{yyyy-MM-dd}.gz)
* `DITTO_LOGGING_MAX_LOG_FILE_HISTORY_IN_DAYS` (default: 10)
In case `DITTO_LOGGING_TOTAL_LOG_FILE_SIZE` is used it is necessary to configure also `DITTO_LOGGING_MAX_LOG_FILE_HISTORY`.
The detailed meaning of these config values is described in the [logback documentation](https://logback.qos.ch/manual/appenders.html#TimeBasedRollingPolicy).
* `DITTO_LOGGING_FILE_NAME_PATTERN` (default: /var/log/ditto/<service-name>.log.%d{yyyy-MM-dd}.gz) - the rollover period is inferred from the fileNamePattern
* `DITTO_LOGGING_MAX_LOG_FILE_HISTORY` (default: 10)
* `DITTO_LOGGING_TOTAL_LOG_FILE_SIZE` (default: 1GB)
* `DITTO_LOGGING_CLEAN_HISTORY_ON_START` (default: false)
* the format in which logging is done is "LogstashEncoder" format - that way the logfiles may easily be imported into
Expand Down
8 changes: 5 additions & 3 deletions gateway/service/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@
<level>info</level>
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- daily rollover as default-->
<!-- The rollover period is inferred from the fileNamePattern -->
<!-- daily rollover as default -->
<fileNamePattern>${DITTO_LOGGING_FILE_NAME_PATTERN:-/var/log/ditto/gateway.log.%d{yyyy-MM-dd}.gz}</fileNamePattern>
<!-- Keep 10 days' worth of history capped at 1GB total size as default-->
<maxHistory>${DITTO_LOGGING_MAX_LOG_FILE_HISTORY_IN_DAYS:-10}</maxHistory>
<!-- Keep 10 days' worth of history capped at 1GB total size as default -->
<!-- maxHistory is based on the rollover period of the fileNamePattern -->
<maxHistory>${DITTO_LOGGING_MAX_LOG_FILE_HISTORY:-10}</maxHistory>
<totalSizeCap>${DITTO_LOGGING_TOTAL_LOG_FILE_SIZE:-1GB}</totalSizeCap>
<cleanHistoryOnStart>${DITTO_LOGGING_CLEAN_HISTORY_ON_START:-false}</cleanHistoryOnStart>
</rollingPolicy>
Expand Down
6 changes: 4 additions & 2 deletions policies/service/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@
<level>info</level>
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- daily rollover as default-->
<!-- The rollover period is inferred from the fileNamePattern -->
<!-- daily rollover as default -->
<fileNamePattern>${DITTO_LOGGING_FILE_NAME_PATTERN:-/var/log/ditto/policies.log.%d{yyyy-MM-dd}.gz}</fileNamePattern>
<!-- Keep 10 days' worth of history capped at 1GB total size as default -->
<maxHistory>${DITTO_LOGGING_MAX_LOG_FILE_HISTORY_IN_DAYS:-10}</maxHistory>
<!-- maxHistory is based on the rollover period of the fileNamePattern -->
<maxHistory>${DITTO_LOGGING_MAX_LOG_FILE_HISTORY:-10}</maxHistory>
<totalSizeCap>${DITTO_LOGGING_TOTAL_LOG_FILE_SIZE:-1GB}</totalSizeCap>
<cleanHistoryOnStart>${DITTO_LOGGING_CLEAN_HISTORY_ON_START:-false}</cleanHistoryOnStart>
</rollingPolicy>
Expand Down
6 changes: 4 additions & 2 deletions things/service/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@
</filter>
<!-- <file>/var/log/ditto/things.log</file>-->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- daily rollover as default-->
<!-- The rollover period is inferred from the fileNamePattern -->
<!-- daily rollover as default -->
<fileNamePattern>${DITTO_LOGGING_FILE_NAME_PATTERN:-/var/log/ditto/things.log.%d{yyyy-MM-dd}.gz}</fileNamePattern>
<!-- Keep 10 days' worth of history capped at 1GB total size as default -->
<maxHistory>${DITTO_LOGGING_MAX_LOG_FILE_HISTORY_IN_DAYS:-10}</maxHistory>
<!-- maxHistory is based on the rollover period of the fileNamePattern -->
<maxHistory>${DITTO_LOGGING_MAX_LOG_FILE_HISTORY:-10}</maxHistory>
<totalSizeCap>${DITTO_LOGGING_TOTAL_LOG_FILE_SIZE:-1GB}</totalSizeCap>
<cleanHistoryOnStart>${DITTO_LOGGING_CLEAN_HISTORY_ON_START:-false}</cleanHistoryOnStart>
</rollingPolicy>
Expand Down
6 changes: 4 additions & 2 deletions thingsearch/service/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@
<level>info</level>
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- daily rollover as default-->
<!-- The rollover period is inferred from the fileNamePattern -->
<!-- daily rollover as default -->
<fileNamePattern>${DITTO_LOGGING_FILE_NAME_PATTERN:-/var/log/ditto/thing-search.log.%d{yyyy-MM-dd}.gz}</fileNamePattern>
<!-- Keep 10 days' worth of history capped at 1GB total size as default -->
<maxHistory>${DITTO_LOGGING_MAX_LOG_FILE_HISTORY_IN_DAYS:-10}</maxHistory>
<!-- maxHistory is based on the rollover period of the fileNamePattern -->
<maxHistory>${DITTO_LOGGING_MAX_LOG_FILE_HISTORY:-10}</maxHistory>
<totalSizeCap>${DITTO_LOGGING_TOTAL_LOG_FILE_SIZE:-1GB}</totalSizeCap>
<cleanHistoryOnStart>${DITTO_LOGGING_CLEAN_HISTORY_ON_START:-false}</cleanHistoryOnStart>
</rollingPolicy>
Expand Down

0 comments on commit aa6221c

Please sign in to comment.