Syslog Config

Description

Install / uninstall the syslog-ng and logrotate config file during package start / stop.

Please refer to syslog-ng on how to write the syslog-ng's config file.

  • Acquire(): Copy patterndb / logratoate to /usr/local/etc/syslog-ng/patterndb.d/ / /usr/local/etc/logrotate.d/. Then reload syslog-ng.
    • If file exists, unlink() it first.
    • Failure on any file copy results in this worker to abort and triggers rollback.
  • Release(): Delete the config files and reload syslog-ng.
    • Ignore unlink() failure.

Provider

DSM

Timing

FROM_STARTUP_TO_HALT

Environment Variables

None

Updatable

No

Syntax

"syslog-config": {
  "patterndb-relpath": "<relpath>",
  "patterninc": [
    {
        "target-dir": "not2msg"
        "conf-relpath": "<relpath>"
    },
    {
        "target-dir": "not2kern"
        "conf-relpath": "<relpath>"
    }
  ],
  "logrotate-relpath": "<relpath>"
}
Member Since Description
patterndb-relpath 6.0-7145 String, syslog-ng's config file's relative path under /var/packages/${package}/target/, ignore this if the log is not generated by syslog-ng (optional)
patterndb-inc 6.1-7610 object array, List of patterndb-inc configs. It defines extra syslog-ng configs to be installed in specified path under the syslog configuration folder
target-dir 6.1-7610 String, The installation target path under /usr/local/etc/syslog-ng/patterndb.d/include/
conf-relpath 6.1-7610 String, The installation source path which is relative to /var/packages/${package}/target/
Usually used to store some extra syslog filter
logrotate-relpath 6.0-5911 String, logrotate's config file's relative path under /var/packages/${package}/target/, ignore this if log is saved to database (optional)

Example

"syslog-config": {
  "patterndb-relpath": "etc/syslog-ng.conf",
  "patterninc": [
    {
        "target-dir": "not2msg"
        "conf-relpath": "etc/NotLog2Msg"
    },
    {
        "target-dir": "not2kern"
        "conf-relpath": "etc/NotLog2Kern"
    }
  ],
  "logrotate-relpath": "etc/logrotate.conf"
}

Please save your package log under /var/packages/[package_id]/var/ (e.g., /var/packages/TextEditor/var/log/texteditor.log)

results matching ""

    No results matching ""