Skip to content

marlboromoo/willie-lumberjack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Willie-Lumberjack

A logging module for Willie [] IRC bot with real-time log viewer.

Willie-
 __                          __                                          __
/\ \                        /\ \                     __                 /\ \
\ \ \      __  __    ___ ___\ \ \____     __   _ __ /\_\     __      ___\ \ \/'\
 \ \ \  __/\ \/\ \ /' __` __`\ \ '__`\  /'__`\/\`'__\/\ \  /'__`\   /'___\ \ , <
  \ \ \L\ \ \ \_\ \/\ \/\ \/\ \ \ \L\ \/\  __/\ \ \/ \ \ \/\ \L\.\_/\ \__/\ \ \\`\
   \ \____/\ \____/\ \_\ \_\ \_\ \_,__/\ \____\\ \_\ _\ \ \ \__/.\_\ \____\\ \_\ \_\
    \/___/  \/___/  \/_/\/_/\/_/\/___/  \/____/ \/_//\ \_\ \/__/\/_/\/____/ \/_/\/_/
                                                    \ \____/
                                                     \/___/

                                      Lumberjack will chopping the log for you.

Features

  • Real-time log viewer
  • Themes (Bootswatch [])
  • Widget

Requirments

Install

Dependency

sudo apt-get install python python-dev python-pip redis-server \
build-essential libevent-dev

Willie-Lumberjack

cd ~
git clone https://github.com/marlboromoo/willie-lumberjack.git
cd willie-lumberjack
git submodule init
git submodule update
sudo pip install requirements.txt
cd ~/.willie/
ln -s ~/willie_lumberjack/lumberjack.py ./modules/
cp ~/willie_lumberjack/config/logbot.cfg ./default.cfg
#. start the ircbot
willie -d
#. start the web server
cd ~/willie-lumberjack 
python web.py start

Update

  1. Stop the ircbot & web server.
#. stop the web server
cd ~/.willie-lumberjack
python web.py stop
#. stop the ircbot
willie -q
  1. Update.
cd ~/willie-lumberjack
git pull
git submodule update
  1. Start the ircbot & web server.
#. start the web server
cd ~/.willie-lumberjack
python web.py start
#. start the ircbot
willie -d

Configuration

Module

Full example can find in the /doc [] folder.

[lumberjack] example purpose
redis_host localhost Redis host
redis_port 6379 Redis port
redis_dbid 0 Redis dbid
channels #foo,#bar IRC channels
log_path /tmp/lumberjack/ Log path

Web Server

Check the config.py [] to see the full example.

Bottle

  • BIND_HOST: IP Address to listen.
  • BIND_PORT: TCP port to listen.
  • LOGFILE: Log path
  • PIDFILE: PID file path.

Redis

  • REDIS_HOST: Redis server address.
  • REDIS_PORT: Redis server port.
  • REDIS_DBID: Redis DB id.

Log

  • LOG_PATH: Path to the plain text log.

Theme

  • DEFAULT_THEME: Default theme.
  • WIDGET_THEME: Default theme for widget.
  • BOOTSWATCH_THEMES: Themes to enable.

Usage

Clean old logs

If you want to keep the logs in 30 days only, you can add following line in /etc/crontab.


#. keep log only 1 month
01 01   * * *   root    find $PATH_TO_IRC_LOGS -ctime +30 | grep -i txt$ | xargs -i rm -f {}

TODO

  • You tell me

Status

[Travis CI Build Status []] Travis CI

Author

Timothy.Lee a.k.a MarlboroMoo.

License

Released under the MIT License.