Python logging message redirection and filtering -


i looking extend single-user console application allow access multiple users. main purpose user see status of system , issue single commands.

all logging performed python's logging module, works great single user can specify logging level interested in seeing in console.

however, when comes allowing multiple users, need abstract simple output of log messages console. question is, best way redirect output of logging module location? also, how can distinguish log level of individual messages in order show varying verbosity different users? guess parse out , the debug/info prefix but, surely, there has better way "tag" individual messages.

more details:

  • at moment, user views messages on local console
  • in future, there more clients connected via web-based terminal emulations ajax updating (hence need more control)

this sounds architectural question.

if understand requirements properly, looking this,

  • you have python based system 1 or more standard python loggers writing text file(s).
  • you need allow several users access logging data in real time, using variety of filtering techniques control access.
  • based on find analysing information, may need issues commands system modify it's behaviour.

given set of requirements, suggest following approach.

  • create centralized database store log records.
  • populate database using standard python logger , custom logging handler communicates directly logger database.
  • develop server based application mediates between web based clients , database.
  • use message queue between server logging manager , original system provide transport mechanism commands users system.

there many packages , tools can used realize scenario assume want python based solution , make number of concrete suggestions.

  • use mongodb database.
  • use mongolog logging handler interface between original system , mongodb database.
  • develop server application in python using twisted core framework.
  • use zeromq message queue between logging manager , original system.

if prepared consider using non-python based solutions suggest using meteor (a javascript based environment) develop both web client environment , logging manager.


Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -