1

I am starting thin in a cluster with 4 thin instances(with Sinatra). It seems that thin creates 4 different log files, one for each instance. I want to override this logging behavior. My requirements :-

  1. Single log file for all thin instances.
  2. Different log files for different aspects of logging(eg. one for requests, another for error etc.)

For this purpose I am thinking of using log4r. Now my question is how exactly do I override this default behavior. Should I simply log everything to my custom logger, but then what about any logs which thin itself generates. How can I replace thin logger with my own custom logger.

randomuser
  • 1,858
  • 2
  • 17
  • 21
  • Can I ask why you want a single log file for all instances? If you did, how could you tell which instance produced the error? – ian Jan 12 '12 at 16:54
  • I don't want to look at all the log files all the time. Also since there are going to be multiple types of logs, the number of log files would become unmanageable. Tracking which instance produced the error is not very difficult, some unique identifier can be appended to each log entry. Also in my case since the server is stateless I would not really need to know which instance produced the error. – randomuser Jan 13 '12 at 05:33
  • This has a nice discussion on a similar topic: http://stackoverflow.com/a/2240842/130111 – m33lky Jun 14 '12 at 23:32

0 Answers0