DEVELOPMENT TOOL: Logging system #14
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently, this application has no logging. This will be a problem at some point if errors ever take place and something needs to be reported.
At some point, this will need to be implemented.
There should exist an interface,
Logger, which will have methods likeWriteandWriteAll. Implementations of the interface can be created to write to files, databases, etc. Simply calling a write method will handle the writing of a log statement to the implementation.A list of loggers will be stored somewhere in the application that can be accessed anywhere. This list can be used to log to many places at the same time.
Maybe: WIP
A queue will exist which will accept a
LogStatementstruct (will all required details) and the queue will execute each statement in order and make a call to each logger provided. Making use of concurrency would be ideal; a routine for each logger for each log? Might create lots of routines, but they're cheap and the ops should be fast. This should also allow for pretty quick turn over. UNLESS we reach race conditions in the DB or in files.When the queue gets too large, maybe we should use the
WriteAllimplementation to write a list of logs to the logger. This would be pretty easy to implement. However, the queue is not as simple.LogStatementData RequirementsType: Enumerated type:
DEBUG,INFO,WARN,ERRORDate: Timestamp of the log (UTC)
Message: String content of the log, could be JSON stringified or textual content
Reference: Optional string content which can be used as a reference point, similar to a stack trace, if errors occur.
ID: Unique UUID for reference. As needed in DB as well.
Reference will be stored in the message, if needed.
All that is left is a way to load the loggers from the environment.
ALMOST COMPLETE! But not 100%! Need to load the log file volume into the docker container, then its done.
Completed with merge.