SystemLogger unrevealed :)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
49 messages Options
123
Reply | Threaded
Open this post in threaded view
|

SystemLogger unrevealed :)

pharo4Stef@free.fr

Logger.pier.pdf (286K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SystemLogger unrevealed :)

NorbertHartl
Great! Thank you!

Norbert

Am 22.02.2014 um 13:24 schrieb Pharo4Stef <[hidden email]>:

> <Logger.pier.pdf>


Reply | Threaded
Open this post in threaded view
|

Re: SystemLogger unrevealed :)

Ben Coman
In reply to this post by pharo4Stef@free.fr
That looks very nice. I wonder whether
    Log warm: 'the system is still running but you should have look at it'.
should be
   Log warn: 'the system is still running but you should have look at it'.


I liked the example ...
    withExtra: [ :log | log extensionAt: #thisContext put: thisContext]

I recently have had some good debugging success using the following...
    Transcript crShow:
        thisContext printString , '  ' ,
        thisContext sender printString , '  ' ,
        thisContext sender sender printString , '  ' ,
        thisContext sender sender sender printString.
...to understand some dynamic behaviour with Announcements where putting
a #halt would lock the system and a #haltOnce didn't provide a broad
enough picture.

It would be cool to be able to do something like...
    Log message: 'Here' withExtra: [ :log | log contextDepth: 4 ]

cheers -ben

Reply | Threaded
Open this post in threaded view
|

Re: SystemLogger unrevealed :)

Göran Krampe
In reply to this post by pharo4Stef@free.fr
Hey!

You didn't know about SimpleLog or?

http://map.squeak.org/packagebyname/simplelog

Not that it matters much, we can all use more logging tools ;) but...
one "mistake" I think is that you don't match the standard syslog levels
as described on the URL above.

SimpleLog even has a Morphic tool with it. Anyway, feel free to take
whatever you like from it.

regards, Göran

Reply | Threaded
Open this post in threaded view
|

Re: SystemLogger unrevealed :)

Ben Coman
Göran Krampe wrote:

> Hey!
>
> You didn't know about SimpleLog or?
>
> http://map.squeak.org/packagebyname/simplelog
>
> Not that it matters much, we can all use more logging tools ;) but...
> one "mistake" I think is that you don't match the standard syslog
> levels as described on the URL above.
>
> SimpleLog even has a Morphic tool with it. Anyway, feel free to take
> whatever you like from it.
>
> regards, Göran
>
>
SimpleLog gets a mention in the PDF.
cheers -ben


Reply | Threaded
Open this post in threaded view
|

Re: SystemLogger unrevealed :)

Göran Krampe
On 02/22/2014 04:30 PM, [hidden email] wrote:

> Göran Krampe wrote:
>> Hey!
>>
>> You didn't know about SimpleLog or?
>>
>> http://map.squeak.org/packagebyname/simplelog
>>
>> Not that it matters much, we can all use more logging tools ;) but...
>> one "mistake" I think is that you don't match the standard syslog
>> levels as described on the URL above.
>>
>> SimpleLog even has a Morphic tool with it. Anyway, feel free to take
>> whatever you like from it.
>>
>> regards, Göran
>>
>>
> SimpleLog gets a mention in the PDF.
> cheers -ben

Nope, that's SimpleLogger.

regards, Göran

Reply | Threaded
Open this post in threaded view
|

Re: SystemLogger unrevealed :)

pharo4Stef@free.fr
In reply to this post by Göran Krampe
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 :).

100 timesRepeat: [Goran repeatAfter: me what: ‘String sucks, string are dead objects’]

I’m coding in Smalltalk and not in perl!
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.

So we should have look at letting string habits outside of our nice house.

Stef

On 22 Feb 2014, at 15:51, Göran Krampe <[hidden email]> wrote:

> Hey!
>
> You didn't know about SimpleLog or?
>
> http://map.squeak.org/packagebyname/simplelog
>
> Not that it matters much, we can all use more logging tools ;) but... one "mistake" I think is that you don't match the standard syslog levels as described on the URL above.
>
> SimpleLog even has a Morphic tool with it. Anyway, feel free to take whatever you like from it.
>
> regards, Göran
>


Reply | Threaded
Open this post in threaded view
|

Re: SystemLogger unrevealed :)

pharo4Stef@free.fr
In reply to this post by Ben Coman

On 22 Feb 2014, at 15:00, [hidden email] wrote:

> That looks very nice. I wonder whether

yes I will fix it.

>   Log warm: 'the system is still running but you should have look at it'.
> should be
>  Log warn: 'the system is still running but you should have look at it'.
>
>
> I liked the example ...
>   withExtra: [ :log | log extensionAt: #thisContext put: thisContext]
>
> I recently have had some good debugging success using the following...
>   Transcript crShow:
>       thisContext printString , '  ' ,
>       thisContext sender printString , '  ' ,
>       thisContext sender sender printString , '  ' ,
>       thisContext sender sender sender printString.
> ...to understand some dynamic behaviour with Announcements where putting a #halt would lock the system and a #haltOnce didn't provide a broad enough picture.
>
> It would be cool to be able to do something like...
>   Log message: 'Here' withExtra: [ :log | log contextDepth: 4 ]

send some doc and update the doc :)

>
> cheers -ben
>


Reply | Threaded
Open this post in threaded view
|

Re: SystemLogger unrevealed :)

pharo4Stef@free.fr
In reply to this post by Göran Krampe
I updated the doc and I’m studying SimpleLog.
For the level of errors if this is easy I will follow sysLog order/default because it is not worth to be different.
tx for the pointer
Stef

PS: now the cool remark would also be to say:
        "Pharo is cool not only cool frameworks are developed but they come with a nice documentation”


On 22 Feb 2014, at 15:51, Göran Krampe <[hidden email]> wrote:

> Hey!
>
> You didn't know about SimpleLog or?
>
> http://map.squeak.org/packagebyname/simplelog
>
> Not that it matters much, we can all use more logging tools ;) but... one "mistake" I think is that you don't match the standard syslog levels as described on the URL above.
>
> SimpleLog even has a Morphic tool with it. Anyway, feel free to take whatever you like from it.
>
> regards, Göran
>


Reply | Threaded
Open this post in threaded view
|

Re: SystemLogger unrevealed :)

Göran Krampe
In reply to this post by pharo4Stef@free.fr
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 :)

- 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.
- Stealing log file rotation perhaps? I think its in there.
- 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."

> 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 (38K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SystemLogger unrevealed :)

Sven Van Caekenberghe-2
In reply to this post by pharo4Stef@free.fr
Reading it now.

There is also the Zinc logging framework, Zinc-HTTP-Logging, already in the image, based on Announcements.

On 22 Feb 2014, at 13:24, Pharo4Stef <[hidden email]> wrote:

> <Logger.pier.pdf>


Reply | Threaded
Open this post in threaded view
|

Re: SystemLogger unrevealed :)

Tudor Girba-2
In reply to this post by pharo4Stef@free.fr
Excellent, Stef!

I reviewed a bit the code:
- The name log denotes the recording of multiple events. However, the Log class models only one event, not many. Thus, a more suitable name would be LogEvent. Or maybe LogEntry (like in StarTrek :))
- Similarly, SystemLogger>>logs should be something like logEvents/logEvents.

I like it a log that LogEvents are full objects because we can subclass them with specific semantics. This is particularly important if we want to build tools for custom applications. The first application I have in mind is Zinc.

Zinc already comes with a logging mechanism that treats LogEvents as objects, but they are all of the same type, so in the end, if you want to track the events for request/response you have to reverse engineer the text. These semantics could be preserved.

From what I see, the main difference between the Zinc log system and the SystemLogger is that the latter has a dispatcher that can dispatch to multiple loggers. Is there anything else that is different? I think it would be cool to merge the two.

Doru


2014-02-22 13:24 GMT+01:00 Pharo4Stef <[hidden email]>:



--

"Every thing has its own flow"
Reply | Threaded
Open this post in threaded view
|

Re: SystemLogger unrevealed :)

hernanmd
In reply to this post by pharo4Stef@free.fr
What's the advantage over Log4s?

Hernán


2014-02-22 9:24 GMT-03:00 Pharo4Stef <[hidden email]>:

Reply | Threaded
Open this post in threaded view
|

Re: SystemLogger unrevealed :)

pharo4Stef@free.fr
In reply to this post by Göran Krampe

On 22 Feb 2014, at 18:12, Göran Krampe <[hidden email]> wrote:

> 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 :)

I’m currently :)
In fact I read all the other frameworks except his ones.

> - 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.
> - Stealing log file rotation perhaps? I think its in there.
> - Stealing whatever else seems good.

Yes I was reading the code and I will package that in extensions.
Now I do not know UDP and others.

> 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.

Indeed this is orthogonal to me. And I want to kill Transcript show

> So actually, I would make sure that SimpleLogger could also easily log in JSON, let me quote from fluentd:

It is just a simple formater. Norbert is using that (if I’m correct) to collect data from his servers with SystemLogger.


>
> "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."
>
>> 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.

Yes I will. If you want I can give you access to the repo.
After I want to avoid to have dependencies to morph because the tiny core should be in the core of Pharo and all the rest pluggable. I want to use SystemLogger for Opal too.

> The SLLogWatchDog is a trivial "send an email if a certain level is reached" with some bundling etc.

Yes I saw :) Nice extension.

> SLLogFile has log file rotation.

Yes I saw I will rewrite it to use FS.

> SLLogMorph is the simple search and filter UI.

Yes I will probably steal it too.

>
> regards, Göran
>
>
> <SimpleLog.st>


Reply | Threaded
Open this post in threaded view
|

Re: SystemLogger unrevealed :)

pharo4Stef@free.fr
In reply to this post by hernanmd

On 22 Feb 2014, at 19:07, Hernán Morales Durand <[hidden email]> wrote:

What's the advantage over Log4s?

I was thinking to reply simplicity and no string bullshit but this could be impolite :)
Frankly I want an extensible object logger that can be domain specific if needed.
All the rest is “extensions” to me. 

I will start to integrate simpleLog as extensions
Stef



Hernán


2014-02-22 9:24 GMT-03:00 Pharo4Stef <[hidden email]>:


Reply | Threaded
Open this post in threaded view
|

Re: SystemLogger unrevealed :)

pharo4Stef@free.fr
In reply to this post by Tudor Girba-2
On 22 Feb 2014, at 18:49, Tudor Girba <[hidden email]> wrote:

Excellent, Stef!

I reviewed a bit the code:
- The name log denotes the recording of multiple events. However, the Log class models only one event, not many. Thus, a more suitable name would be LogEvent. Or maybe LogEntry (like in StarTrek :))

in the class comment :)

!! Design notes.
I'm named Log and not SLLogObject or whatever because I'm the main entry point for a client point of view. 

- Similarly, SystemLogger>>logs should be something like logEvents/logEvents.

I changed it to logEntries. 

I’m interested in extensions to stress the design and extension points of SystemLogger :)
On 22 Feb 2014, at 18:49, Tudor Girba <[hidden email]> wrote:
Reply | Threaded
Open this post in threaded view
|

Re: SystemLogger unrevealed :)

pharo4Stef@free.fr
In reply to this post by Göran Krampe
Goran

do you know the JSON format I meand not format but schema to be compatible with fluentd because this could be a nice
extension.

Stef

> 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."



Reply | Threaded
Open this post in threaded view
|

Re: SystemLogger unrevealed :)

pharo4Stef@free.fr
In reply to this post by hernanmd
Hernan

do you know how we could produce an extension that can plug into Log4J and Log4s :)
BTW the last time I check I could not really load Log4s :)

Stef


On 22 Feb 2014, at 19:07, Hernán Morales Durand <[hidden email]> wrote:

What's the advantage over Log4s?

Hernán


2014-02-22 9:24 GMT-03:00 Pharo4Stef <[hidden email]>:


Reply | Threaded
Open this post in threaded view
|

Re: SystemLogger unrevealed :)

hernanmd

2014-02-22 15:50 GMT-03:00 Pharo4Stef <[hidden email]>:
Hernan

do you know how we could produce an extension that can plug into Log4J and Log4s :)

I don't know, sorry.

 
BTW the last time I check I could not really load Log4s :)

That's weird because I'm using in production since weeks ago from daily fresh built 3.0 images :)
I've checked now from Configuration Browser and all +200 tests passes.

I cannot say for 2.0, I decided to stop maintaining packages for older versions.

I will check your Logger and see how it goes.

Hernán
 


Reply | Threaded
Open this post in threaded view
|

Re: SystemLogger unrevealed :)

Göran Krampe
In reply to this post by pharo4Stef@free.fr
On 02/22/2014 07:49 PM, Pharo4Stef wrote:
> Goran
>
> do you know the JSON format I meand not format but schema to be compatible with fluentd because this could be a nice
> extension.

Not sure, no. But i can check tomorrow.

regards, Göran


123