This logger is built to aggregate all logs from multiple server to have a centralized list of wtf is going on
View logs at http://logger/
, a webpage with a human readable list of logs with a searchable form
Logs are written to file in human readable format so you can tail/watch/grep the file on the logging server
http://logger/log
http://logger/log.mobile
http://logger/log.dispatch
Post your log message to the url http://logger/logs/new
For right now it needs a Content-Type: applications/json
http header.
Also, since mongo is the database back-end, you can pretty much send anything, but this is the recommended format for now (welcome to changes).
(req) = required; (opt) = optional
{
time: Number, // (req) Contains the time in milliseconds since 1970 of the log message
level: String, // (req) Level of the log message `['WARN', 'INFO', 'ERROR']`
ip: String, // (req) Source IP Address of the log message
line_num: String, // (opt) Line number related to the error/warning/info
body: String, // (opt) Any additional information to send with the error (i.e. a stacktrace, detailed error message)
component: String, // (req) System that the log message belongs too `['mobile', 'dispatch', 'etc']`
}
{ url: '/logs/new' ,
method: 'POST',
headers: { 'Content-Type' : 'application/json' },
data: JSON.stringify(
{
time: 1306469069405,
level: 'WARN',
ip: '127.0.0.1',
line_num: 'NSCreditCardController.m:1337',
body: 'Permission to API call denied',
component: 'mobile'
}
)
}
You can also send multiple logs with one payload by making data json array of log messages
Logger will monitor the incoming logs to for dangerous error logs. If found, logger will automatically notify the engineer that owns that piece of the code.
For example, if the iphone app experiences a critical error, the mobile engineer will be emailed with the log of the error message and a ticket for the error will be created.
NOTE: Temporarily in memory, will move to mongo soon.
Every 30s, logger will query the database for anything that matches the engineers criteria that hasn't been dispatched. If any is found, logger will create a ticket and notify the engineer
Engineers are saved in the database as a json object with an email
and filter
(Still working on the schema design, will definitely change)
email
- engineer's notification email
filter
- criteria to match against log messages
{
email: '[email protected]',·
filter: {
level: 'ERROR',
component: 'dispatch'
}
}
Tie the logging system with an automated ticket system if there isn't one with an API to tie into. Potentially develop a google chrome extension to act as a ticket system within uber cab's gmail. Here's a mockup of the potential idea