DLT 本地log功能配置

2 篇文章 2 订阅

dlt本地log

需要指定APP NAME和CONTEX NAME才能保存对应的log。

1、操作过程:
在dlt.conf中打开本地log的配置项:
在这里插入图片描述

然后再在OfflineLogstorageDirPath路径下创建本地log规则文件:dlt_logstorage.conf
在文件中写入过滤规则:
在这里插入图片描述

再启动dlt-daemon -c /etc/dlt.conf -d,这样就可以让dlt针对LOG 这个app中以TEST为名的ctx的log(log等级大于DLT_LOG_WARN)都保存在/opt/test下的dlt文件中。
在这里插入图片描述

这个文件应该可以用dlt-veiwer打开。

2、dlt关于本地log的帮助可以在 doc/dlt_offline_logstorage.md 文件中找到。

3、帮助文档中的测试方法:

## Testing DLT Offline Logstorage

The following procedure can be used to test Offline Logstorage:

- Enable OfflineLogstorage by setting OfflineLogstorageMaxDevices = 1 in dlt.conf
- Start dlt-daemon
- The default search path of logstorage is: /tmp/dltlogs/dltlogsdevX   where X is a number in the range [1..OfflineLogstorageMaxDevices]

- Create the device folder

    ```
  $ mkdir -p /var/dltlog
    ```

- Create the configuration file "dlt\_logstorage.conf" in this folder   and define filter configuration(s):

    ```
    [FILTER1]   
    LogAppName=LOG   
    ContextName=TEST   
    LogLevel=DLT_LOG_WARN   
    File=example   
    FileSize=50000   
    NOFiles=5   
    ```

- Trigger dlt-daemon to use a new device

    ```
    $ dlt-logstorage-ctrl -c 1 -p /var/dltlog
    ```

- Start dlt-example-user

    ```
    $ dlt-example-user Hello123
    ```

- After execution, a log file is created in /var/dltlogs
- 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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值