Another Log implementation

Matthew Ong ongbp at yahoo.com
Sat Jun 4 02:08:44 PDT 2011


On 5/30/2011 6:35 AM, Vincent wrote:
> Small work on issues: http://pastebin.com/fd3UCgjv
Hi Vincent,

 > Great! Didn't catch it from docs, sorry. Anyway, it's not 'verbosity' as
 > meaning in english - it's FILTERING and yep, this is useful. But all
 > those 'verbose level 1, 2, 3....' that's ridiculous.
Perhaps you are looking only as creating log file to aid you in 
debugging runtime state of your network application and not concern 
about other issue such as security and hacking attacks.

Day to day network admin person will have to analyze log generated by a
server application that he/she is tasked to maintained
http://www.techrepublic.com/blog/opensource/how-do-i-customize-apache-server-log-files-to-track-my-web-site/71
I am using apache server as an example, as it is one well know and 
widely used server. Others may have similar to such data captured.
Common Log Format (CLF).

However, there is no business logic trace information for developer
to do debugging.

Verbosity and Log level is very important to Network Admin Person
http://www.securityweek.com/content/how-defend-against-ddos-attacks

Please see:
3. Dump the logs
If you find log files growing large quite quickly, you're faced with the 
choice between keeping the data and losing the server, or losing the 
data and keeping the server.

BTW, if log library designed properly, the server can turn on-off
different level of the logging activity without having to restart
the entire state of the application.

The Log level allow Admin person to do log filtering and analyze the
damaged done if there is abnormal activity or hacking done on the
application.

If there is ONLY single level logging, the log file/files will grow
and grow until the resource is eaten up by disk IO and CPU context
switch, and also network is fully chocked because of the DDOS.

 >There is not so much 'log specific' stuff, some of 'em is just a 
'tradition'. Log is TEXT, which help you to debug code.
-----
 >2. Nobody prevent you from doing it! Just make 'mixin' with __FILE__ 
and use.
 >3. In my practice I didn't see so low-level approach for debugging - 
well organised log shows enough, why people care about number of code 
line in editor?? Funny, heh...
------
I entirely agrees with you here. As web application developer, SMTP
mail client, or protocol X consumer application, they are more concerned
about what is the state of the application if the application crashed
or compromised by hacker. How to roll back the last action done or track
damages done?

__FILE__ + __LINE__ is too little information.

That is why I posted another new thread:
How about adding NEW Special Tokens?? For ease and Security.

*new compile time information's tokens*

and

*runtime special tokens*

Could those token have help you? I believe it does because it is at
least listed by apache web server group as 'common' item.
---------------------------------------------------------------------------------

Different topic, implementing the logging could be done also...

 >1. Minimal logging must be as simple as one function call with one 
string argument.  Partially agrees, but that can be done.

 >2. Log must support multiple destinations of different kind.
    Totally agrees, here: File, syslog, sql, smtp, sms,
    Different company has different network admin policy for different 
application.

 >3. Destinations must be easy expandable - one simple class for any kind.


 >4. Enable/Disable log at run/compile time. IDEALLY doesn't consume CPU 
if completely disabled.
Totally agrees. No extra comment needed.

 >5. Suppport for different output formats.
Totally agrees, it should be easily configurable by an Network Admin 
person and NOT only developer.

:) :) :)

Do help to comment about this also:
How about adding NEW Special Tokens?? For ease and Security.
I may have loose something out.

-- 
Matthew Ong
email: ongbp at yahoo.com



More information about the Digitalmars-d mailing list