qiyutech.core.logger module – 写入日志到 journald 或 文件中¶
备注
This module is part of the qiyutech.core collection (version 1.0.0).
You might already have this collection installed if you are using the ansible package.
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install qiyutech.core.
To use it in a playbook, specify: qiyutech.core.logger.
1.0.0 新版功能: of qiyutech.core
Synopsis¶
写入日志到 journald 或者 临时文件中
备注
This module has a corresponding action plugin.
Parameters¶
Parameter |
Comments |
|---|---|
自动删除临时文件 自动删除写入 journald 的时候创建的临时文件 Choices:
|
|
上下文 |
|
日志等级 Choices:
|
|
消息标识 消息标志, journald 中的 MESSAGE_ID, 用户所有的上下文 通过获取:
如果都没则会自动创建 一个新的 MESSAGE_ID 并 使用 set_facts 复制给 qiyu_log_message_id |
|
日志消息 |
|
日志存储位置
Choices:
|
Notes¶
备注
这个模块不支持 Windows 系统
Examples¶
- name: 写入日志
qiyutech.core.logger:
msg: hello
ctx:
key: value