In fact, this article said that the "distributed log Framework" has the title party suspects. To deceive the people is actually to let us guide some ideas, exchange experience.
Recently read a book on architecture, in which there is a sentence that I have a profound impact: in the absence of the need to understand the needs of the people to do the structure of the failure is always more than success.
Think carefully, in fact, quite reasonable.
As far as I am concerned, when I decide to make a framework, I think I understand the need, and take the requirements to start defining the interface to write code, but generally this situation, I will rework, why? Because I can't write it down .....
This time the log frame is relative to the previous one, I added the message queue to make the log buffer read and write after the log has been written to send a message notification.
My idea is that the user calls the Log.write method, only the incoming log entity, in the method will automatically determine whether to write to the queue or write directly to a media.
Diagram:
Part of the interface functions as follows:
Logmanager: Log manager, when a user instantiates a logmanager, it only needs to call write to write the log.
Ilogproviderbulid: The log provider constructor that constructs the specified Ilogprovider program through a configuration file
Iqueueproviderbulid: Queue provider Constructor, coinage configuration file constructs the specified Iqueueprovider
INOTICEABLE: Message Notification interface
A description of some of the properties of the log entity:
Code: Error code
ErrorType: The error type corresponds to an enumeration
Exexception: Exception Object
Isdebug: Whether it belongs to debug mode
Issendmessage: Whether to send a message
Message: User-defined messages
Code words have not finished, no unexpected words I will be in the Mid-Autumn Festival before the code upload to GitHub, this framework will certainly have some shortcomings, I hope we can discuss together and communicate with each other. Go to sleep.
Talk about my heart. Distributed log Processing framework