Am 22.02.2014 um 18:12 schrieb Göran Krampe <[email protected]>:

> Hi!
> 
> On 02/22/2014 05:26 PM, Pharo4Stef wrote:
>> Hi goran
>> 
>> There are only two questions:
>>      'Why when I load code do I have to open the transcript before to see 
>> the shadow and undeclared.
>>      and why I cannot click on an object and jump to the broken code?"
>> 
>> Now with SimpleLogger I imagine that I cannot log compiler shadow, don’t you 
>> :).
> 
> I am not quite sure what you are saying... Ah, you mean logging objects 
> instead of strings? Sure, I didn't say SimpleLog was BETTER, I just said you 
> didn't look at it and thus may be missing out on nice stuff that you can 
> steal :)
> 
Sure, seems so nobody knew about it then :)

> - Using syslog levels, it is very standard and logging these days of clouds 
> do NOT stay on the local machine.
> - Stealing the syslog emitter, it is just 20 lines of code.

That is a nice extension to SystemLogger.

> - Stealing log file rotation perhaps? I think its in there.

Are you are using this? I think it is not too common to do that in your 
application because there are tools like logrotate that do those things way 
better with compressing, deleting files, etc.. The only thing it needs is that 
the filestream sees when the file is gone and reopens.

> - Stealing whatever else seems good.
> 
> Having log objects in the image is great.
> 
>> 100 timesRepeat: [Goran repeatAfter: me what: ‘String sucks, string are dead 
>> objects’]
> 
> Well, do remember that logs in a "system world" end up getting routed through 
> syslog (and tons of variations on that theme) and eventually end up in event 
> collecting systems etc - just look at fluentd.org to understand what I mean.
> 
> So actually, I would make sure that SimpleLogger could also easily log in 
> JSON, let me quote from fluentd:
> 
> "Fluentd treats logs as JSON, a popular machine-readable format. It is 
> written primarily in C with a thin-Ruby wrapper that gives users flexibility.
> 
> Fluentd’s performance has been proven in the field: its largest user 
> currently collects logs from 5000+ servers, 5 TB of daily data, handling 
> 50,000 msgs/sec at peak time.“

This is also a nice extension to the SystemLogger. The goal of the framework is 
simplicity _and_ extendability so you can add your use case with ease. 
I personally decided against using fluentd because I try to avoid much of the 
system complexity if I don’t need it (I have not even close to 50000 reqs/s). 
Putting the logs from within the image into syslog only to have it transported 
to fluentd wouldn’t be a clever thing to do. First you squeeze your object into 
a string just to have the fluentd tool apply a filter to create a json object 
of it. So converting a log to JSON and put it directly into fluentd would be 
the way to go. This way you can have fluentd for the buffering and for the 
single point of configuration for the log sink.
If you look at the FormattingLogger it does provide the hooks for this. There 
is a conversion and a storing method because these are two things you want to 
adjust if you need a different format like JSON and a different way of storing 
(sockets, http,…).
I use the SystemLogger to put all the logs into elasticsearch directly. 

Norbert

> 
>> I’m coding in Smalltalk and not in perl!
> 
> In fact, now that I am looking at SimpleLog I realize we could have had an 
> emitter that collected objects and just let "message" be whatever - and send 
> asString or asJSON to it when it reaches the emitter instead.
> 
>> Now if you want to have syslog output this is probably one method definition 
>> in a new formatter in our nice frameworks.
>> Do you have an output that shows what is needed for sysLog? because I can 
>> add a package for sysLog outputter.
> 
> Its very short code. Just steal it. I attached all the code as an .st fileout 
> so that you can get it trivially. Its the SLSyslogSender class.
> 
> The SLLogWatchDog is a trivial "send an email if a certain level is reached" 
> with some bundling etc.
> 
> SLLogFile has log file rotation.
> 
> SLLogMorph is the simple search and filter UI.
> 
> regards, Göran
> 
> 
> <SimpleLog.st>


Reply via email to