You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
857 B

5 years ago
# logger
7 years ago
6 years ago
## 说明
7 years ago
**logger命令** 是用于往系统中写入日志他提供一个shell命令接口到syslog系统模块
5 years ago
## 选项
7 years ago
5 years ago
```markdown
-T, --tcp 只使用 TCP
-d, --udp 只使用 UDP
-i, --id 同时记录进程 ID
-f, --file <文件> 记录此文件的内容
-h, --help 显示此帮助并退出
-S, --size <num> maximum size for a single message (default 1024)
-n, --server <name> write to this remote syslog server
-P, --port <port> use this port for UDP or TCP connection
-p, --priority <prio> mark given message with this priority
-s, --stderr output message to standard error as well
-t, --tag <标志> 用此标志标记每一行
-u, --socket <套接字> 写入此 Unix 套接字
7 years ago
```
5 years ago
## 实例
7 years ago
5 years ago
```bash
7 years ago
logger -p syslog.info "backup.sh is starting"
```
6 years ago