summaryrefslogtreecommitdiff
path: root/doc/dlt_offline_logstorage.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/dlt_offline_logstorage.md')
-rw-r--r--doc/dlt_offline_logstorage.md88
1 files changed, 52 insertions, 36 deletions
diff --git a/doc/dlt_offline_logstorage.md b/doc/dlt_offline_logstorage.md
index d028862..e21a574 100644
--- a/doc/dlt_offline_logstorage.md
+++ b/doc/dlt_offline_logstorage.md
@@ -4,8 +4,9 @@ Back to [README.md](../README.md)
## Introduction to DLT Offline Logstorage
-Logstorage is a mechanism to store DLT logs on the target system or an external device (e.g. USB stick) connected to the target.
-It can be seen as an improvement of the Offline Trace functionality which is already part of DLT.
+Logstorage is a mechanism to store DLT logs on the target system or an external
+device (e.g. USB stick) connected to the target. It can be seen as an
+improvement of the Offline Trace functionality which is already part of DLT.
Logstorage provides the following features:
- Store logs in sets of log files defined by configuration files
@@ -28,7 +29,8 @@ Logstorage provides the following features:
### General Configuration
-General configuration is done inside dlt.conf. The following configuration options exist:
+General configuration is done inside dlt.conf. The following configuration
+options exist:
```
##############################################################################
@@ -57,7 +59,9 @@ General configuration is done inside dlt.conf. The following configuration optio
### Configuration file format
-For DLT daemon to store logs the configuration file named “dlt_logstorage.conf” should be present in external storage or internal storage device (= given path in the file system).
+For DLT daemon to store logs the configuration file named “dlt\_logstorage.conf”
+should be present in external storage or internal storage device (= given path
+in the file system).
```
[Filter<unique number>] # filter configration name
@@ -72,7 +76,8 @@ EcuID=<ECUid> # Specify ECU identifier
SpecificSize=<spec size in bytes> # Store logs in storage devices after specific size is reached.
```
-The Parameter "SyncBehavior","EcuID" and "SpecificSize" are optional - all others are mandatory.
+The Parameter "SyncBehavior","EcuID" and "SpecificSize" are optional - all
+others are mandatory.
An configuration file might look like:
@@ -110,31 +115,30 @@ EcuID=ECU1
## Usage DLT Offline Logstorage
-Enable OfflineLogstorage by setting ```OfflineLogstorageMaxDevices = 1``` in dlt.conf.
-Be aware that the performance of DLT may drop if multiple Logstorage devices are used; the performance depends on the write speed of the used device, too.
+Enable OfflineLogstorage by setting ```OfflineLogstorageMaxDevices = 1``` in
+dlt.conf. Be aware that the performance of DLT may drop if multiple Logstorage
+devices are used; the performance depends on the write speed of the used device,
+too.
Create the device folder:
-```
-mkdir -p /var/dltlogs
-```
+```mkdir -p /var/dltlogs```
-Create a configuration file and store it on into that folder or mount an external device containing a configuration file.
+Create a configuration file and store it on into that folder or mount an
+external device containing a configuration file.
-Start the DLT Daemon. This is not necessary if the DLT Daemon was started already with Offline Logstorage enabled.
+Start the DLT Daemon. This is not necessary if the DLT Daemon was started
+already with Offline Logstorage enabled.
Trigger DLT Daemon to use the new logstorage device:
-
```dlt-logstorage-ctrl -c 1 -p /var/dltlogs```
-
-Afterwards, logs that match the filter configuration are stored onto the Logstorage device.
-
+Afterwards, logs that match the filter configuration are stored onto the
+Logstorage device.
```dlt-logstorage-ctrl -c 0 -p /var/dltlogs```
-
The configured logstorage device is disconnected from the DLT Daemon.
@@ -151,6 +155,7 @@ Options:
-e Set ECU ID (Default: ECU1)
-h Usage
-p Mount point path
+ -s Sync Logstorage cache
-t Specify connection timeout (Default: 10s)
-v Set verbose flag (Default:0)
```
@@ -168,16 +173,18 @@ The following procedure can be used to test Offline Logstorage:
```$ mkdir -p /var/dltlog```
-- Create the configuration file "dlt_logstorage.conf" in this folder
+- Create the configuration file "dlt\_logstorage.conf" in this folder
and define filter configuration(s):
- ```$printf "[FILTER1]
+ ```
+ [FILTER1]
LogAppName=LOG
ContextName=TEST
LogLevel=DLT_LOG_WARN
File=example
FileSize=50000
- NOFiles=5" > /tmp/dltlogs/dltlogsdev1/dlt_logstorage.conf```
+ NOFiles=5
+ ```
- Trigger dlt-daemon to use a new device
@@ -188,28 +195,37 @@ The following procedure can be used to test Offline Logstorage:
```$ dlt-example-user Hello123```
- After execution, a log file is created in /var/dltlogs
- e.g. example_001_20150512_133344.dlt
+ e.g. example\_001\_20150512\_133344.dlt
- To check the content of the file open it with dlt-convert or DLT Viewer.
## Logstorage Ring Buffer Implementation
-The DLT Logstorage is mainly used to store a configurable set of logs on an external mass storage device attached to the target.
-In this scenario, writing each incoming log message directly onto the external storage device is appreciate, because the storage device might be un-mounted/suddenly removed at any time.
-Writing each log message immediately avoids the problem of losing too many messages because the file system sync could not be finished before the device has been removed physically from the target.
-On the other hand the DLT Logstorage feature might be used as well to store a configurable set of logs on any internal, nonvolatile memory (e.g. FLASH storage device).
-Due to the reason of limited write cycles of a FLASH device the number of write cycles has to be reduced as much as possible.
-But the drawback of losing log messages in case of an unexpected operating system crash has to be taking into account as well.
-The obvious idea is to cache incoming log messages in memory and write the log data to disk based on a certain strategy.
-Incoming log messages are stored in a data cache with a specific size. Depending on user defined strategy, the data cache is written onto the storage device、without relying on the sync mechanism of the file system.
+The DLT Logstorage is mainly used to store a configurable set of logs on an
+external mass storage device attached to the target. In this scenario, writing
+each incoming log message directly onto the external storage device is
+appreciate, because the storage device might be un-mounted/suddenly removed at
+any time. Writing each log message immediately avoids the problem of losing too
+many messages because the file system sync could not be finished before the
+device has been removed physically from the target. On the other hand the DLT
+Logstorage feature might be used as well to store a configurable set of logs on
+any internal, nonvolatile memory (e.g. FLASH storage device). Due to the reason
+of limited write cycles of a FLASH device the number of write cycles has to be
+reduced as much as possible. But the drawback of losing log messages in case of
+an unexpected operating system crash has to be taking into account as well. The
+obvious idea is to cache incoming log messages in memory and write the log data
+to disk based on a certain strategy. Incoming log messages are stored in a data
+cache with a specific size. Depending on user defined strategy, the data cache
+is written onto the storage device、without relying on the sync mechanism of the
+file system.
The following strategies are implemented:
-- ON_MSG - sync every message(Default)
-- ON_DAEMON_EXIT - sync on daemon exit
-- ON_DEMAND - sync on demand
-- ON_FILE_SIZE - sync on file size reached
-- ON_SPECIFIC_SIZE - sync after specific size is reached
+- ON\_MSG - sync every message(Default)
+- ON\_DAEMON\_EXIT - sync on daemon exit
+- ON\_DEMAND - sync on demand
+- ON\_FILE\_SIZE - sync on file size reached
+- ON\_SPECIFIC\_SIZE - sync after specific size is reached
Note :
-1. Combinations (not allowed: combinations with ON_MSG,combination of ON_FILE_SIZE with ON_SPECIFIC_SIZE)
-2. If on_demand sync strategy alone is specified, it is advised to concatenate the log files in sequential order before viewing it on viewer.
+1. Combinations (not allowed: combinations with ON_MSG,combination of ON\_FILE\_SIZE with ON\_SPECIFIC\_SIZE)
+2. If on\_demand sync strategy alone is specified, it is advised to concatenate the log files in sequential order before viewing it on viewer.