0.0
No commit activity in last 3 years
No release in over 3 years
Adds entries to a logfile, only if they don't already exist. The logfile can be on a remote server
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
>= 0
~> 10.0
>= 0
 Project Readme

UniqLogger

  • Add entries to an logfile, only if an uniq id is not already used.
  • automaticaly generate logfile rotations: new logfile für every day, motnh or year
  • send your logentries to another server per api using the same gem once as client and as a server
  • creates an CSV formated file which can be easely opened in e.g. Excel for endusers

Installation

Add this line to your application's Gemfile:

gem 'uniq_logger'

And then execute:

$ bundle

Or install it yourself as:

$ gem install uniq_logger

Usage

Create a configuration file config/uniq_logger.yml (view section 'Configuration')

To create a logentry use:

require 'uniq_logger'
uniq_logger = UniqLogger.new
uniq_logger.create("UniqID", ["data","to","save"] )

Configuration File

app/config/uniq_logger.yml

#Use a additional Log-Rotator which generates new logfiles for ['day','month','year'].
#Default 'none'
log_rotator: "month"

#If log_rotator is set, this will be the prefix for the file name 
log_rotator_prefix: "uniq_logger-"


#Use a global LogFile [true,false]. Chech for existin logs only looks in global logfile
#Default true
global_logger: true

#Name of the logfile to write to
global_log_file_name: "uniq_logger.log"


#if set to true, logentry creation returns 'false' if a logentry already exists with this ID
# This is only on global Logfiles possible
validates_uniqness_of_id: true

#If a local Logfile should be created or a ftp Account ['local', 'remote']
logfile_destination: "local"

#Path where Logfiles should be saved
path_to_local_logfiles: "../log/"

#If logfile_destination is set to 'remote' use folloing api credentials
remote:
  auth_token: "xyz123abc"
  server: "http://www.server.de"
  endpoint: "/api/v1/logger"
  url_param_for_id: "id"
  url_param_for_data: "data"
  basic_auth:
    username: ""
    password: ""

#CSV Export Settings: Encoding Type (default 'utf8'), Column Separator (default ';')
csv:
  encoding: "UTF8"
  col_sep: ";"

Contributing

  1. Fork it ( https://github.com/[my-github-username]/uniq_logger/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request