Coder Social home page Coder Social logo

syslog-ng's Introduction

Description

The Syslog NG cookbook installs and configures syslog-ng service. There are two recipes

  • syslog-ng enables syslog-ng but does not affect your current syslog configuration
  • syslog-ng::global disables your existing syslog and configures syslog-ng to handle system logging

There are also four definitions

  • syslog_ng_source configures syslog-ng to listen on a udp port
  • syslog_ng_filter configures a filter
  • syslog_ng_file configures syslog-ng to write logs it receives to a file
  • syslog_ng_forwarder configures syslog-ng to forward logs it receives to another syslog server

The path to logfiles is generated by concatenating log_base, the application name, and log_name. When setting log_base and log_name you can use syslog-ng macros. For example, log_name could be "${YEAR}/${MONTH}/${DAY}/${HOUR}.log"

The cookbook has been written for and tested on CentOS with syslog-ng 2.1.4. Syslog NG can be obtained here: balabit.com.

Requirements

  • Chef 0.8+
  • Syslog-NG 2.x package

Usage

In a run list:

"run_list": [
    "recipe[syslog-ng]"
]

In a cookbook:

include_recipe "syslog-ng"

syslog_ng_source "source_foo" do
  index "02"
  host "127.0.0.1"
  port "514"
end

syslog_ng_file "application_foo" do
  index "03"
  source_name "source_foo"
  days_uncompressed "7"
  log_base "/var/applogs"
  log_name "default.log"
end

syslog_ng_filter "warnings" do
  index  "04"
  filter "level(warning)"
end

syslog_ng_forwarder "application_foo_warnings" do
  index "05"
  source_name "source_foo"
  filter_name "warnings"
  destination_host "example.com"
  destination_port "514"
  destination_protocol "udp"
end

License and Author

Author:: Artem Veremey ([email protected])

Copyright 2012, Artem Veremey

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Changes

v 1.3.0

  • Create filter definition and have file and forwarder optionally take a filter

v 1.2.0

  • Break source out into its own definition

v 1.1.0

  • adding a new definition for configuring forwarding
  • renaming the defintion that writes files to make that clearer in the name
  • in the definition for writing files, allow specifying file name
  • in the definition for writing files, compress old log files
  • moving system logging configuration from the default recipe to a new recipe

v 1.0.0

  • Initial public release

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.