[Pharo-project] Log framework
Hi all. Im looking for a log framework with configurable levels. Theres any stable and useful? I browsed the list and didn't find nothing but something like 'every body has its own logging framework'. I wrote a small logging fwk for my project, but if is any more complete, it would be great. Thanks.
Hi. Today I saw this in pharo news http://code.google.com/p/nagare-logger/ and previusly this thread http://forum.world.st/I-would-really-like-to-get-a-structured-logging-framew... Early of my last project I saw those (maybe page is obsolete) http://book.pharo-project.org/book/LanguageAndLibraries/LoggingTools... and finally I too made my own log framework, but for next project I want to use something better that of mine. Regards. 2012/5/29 Santiago Bragagnolo <santiagobragagnolo@gmail.com>
Hi all.
Im looking for a log framework with configurable levels. Theres any stable and useful? I browsed the list and didn't find nothing but something like 'every body has its own logging framework'.
I wrote a small logging fwk for my project, but if is any more complete, it would be great.
Thanks.
On Wed, May 30, 2012 at 2:51 AM, Gastón Dall' Oglio < gaston.dalloglio@gmail.com> wrote:
Hi.
Today I saw this in pharo news http://code.google.com/p/nagare-logger/and previusly this thread http://forum.world.st/I-would-really-like-to-get-a-structured-logging-framew...
Early of my last project I saw those (maybe page is obsolete) http://book.pharo-project.org/book/LanguageAndLibraries/LoggingTools... and finally I too made my own log framework, but for next project I want to use something better that of mine.
I did a very log based on German Arduino simple logger. You can find it in http://ss3.gemstone.com/ss/Marea package SimpleLogger
Regards.
2012/5/29 Santiago Bragagnolo <santiagobragagnolo@gmail.com>
Hi all.
Im looking for a log framework with configurable levels. Theres any stable and useful? I browsed the list and didn't find nothing but something like 'every body has its own logging framework'.
I wrote a small logging fwk for my project, but if is any more complete, it would be great.
Thanks.
-- Mariano http://marianopeck.wordpress.com
On 30 May 2012, at 01:56, Santiago Bragagnolo wrote:
Im looking for a log framework with configurable levels. Theres any stable and useful? I browsed the list and didn't find nothing but something like 'every body has its own logging framework'.
I wrote a small logging fwk for my project, but if is any more complete, it would be great.
There is one logging framework already in your image: Zinc-HTTP-Logging. It is based on Announcments. Although it is part of Zn, it is general purpose. What is special is that it logs the process ID as well, which is useful to debug multiprocess applications. See the Zn documentation for more info. Sven
On May 30, 2012, at 10:03 AM, Sven Van Caekenberghe wrote:
On 30 May 2012, at 01:56, Santiago Bragagnolo wrote:
Im looking for a log framework with configurable levels. Theres any stable and useful? I browsed the list and didn't find nothing but something like 'every body has its own logging framework'.
I wrote a small logging fwk for my project, but if is any more complete, it would be great.
There is one logging framework already in your image: Zinc-HTTP-Logging. It is based on Announcments. Although it is part of Zn, it is general purpose. What is special is that it logs the process ID as well, which is useful to debug multiprocess applications. See the Zn documentation for more info.
We should really think about promoting one framework to be the one-and-only to be used in the image itself... Marcus -- Marcus Denker -- http://marcusdenker.de
Marcus Denker wrote:
On May 30, 2012, at 10:03 AM, Sven Van Caekenberghe wrote:
On 30 May 2012, at 01:56, Santiago Bragagnolo wrote:
Im looking for a log framework with configurable levels. Theres any stable and useful? I browsed the list and didn't find nothing but something like 'every body has its own logging framework'.
I wrote a small logging fwk for my project, but if is any more complete, it would be great.
There is one logging framework already in your image: Zinc-HTTP-Logging. It is based on Announcments. Although it is part of Zn, it is general purpose. What is special is that it logs the process ID as well, which is useful to debug multiprocess applications. See the Zn documentation for more info.
We should really think about promoting one framework to be the one-and-only to be used in the image itself...
Marcus
-- Marcus Denker -- http://marcusdenker.de
Or a defined API that can be swapped out underneath for different implementations.
see http://book.pharo-project.org/book/LanguageAndLibraries/LoggingTools/ On Wed, May 30, 2012 at 4:08 PM, Ben Coman <btc@openinworld.com> wrote:
Marcus Denker wrote:
On May 30, 2012, at 10:03 AM, Sven Van Caekenberghe wrote:
On 30 May 2012, at 01:56, Santiago Bragagnolo wrote:
Im looking for a log framework with configurable levels. Theres any stable and useful? I browsed the list and didn't find nothing but something like 'every body has its own logging framework'. I wrote a small logging fwk for my project, but if is any more complete, it would be great.
There is one logging framework already in your image: Zinc-HTTP-Logging. It is based on Announcments. Although it is part of Zn, it is general purpose. What is special is that it logs the process ID as well, which is useful to debug multiprocess applications. See the Zn documentation for more info.
We should really think about promoting one framework to be the one-and-only to be used in the image itself...
Marcus
-- Marcus Denker -- http://marcusdenker.de
Or a defined API that can be swapped out underneath for different implementations.
-- Mariano http://marianopeck.wordpress.com
We should really think about promoting one framework to be the one-and-only to be used in the image itself...
Marcus
-- Marcus Denker -- http://marcusdenker.de
Or a defined API that can be swapped out underneath for different implementations.
Right. That would be awesome. The problem is to know which features should be included and how it maps to the different backends... -- http://tulipemoutarde.be CA: +1 778 558 3225 BE: +32 65 709 131
Ok, i'll take what i need from the marianito's and zn and fork them in an other package, add what i need for massive loggin (like levels of loggin) and make a log-framework. Any names? clairvoyant :3? Then, is any easy aspect fwk that could i use for the logger? (sometimes i need just trace runtime, or i dont want to add a log line one by one) that works in pharo 2.0 ? :P? 2012/5/30 Sven Van Caekenberghe <sven@beta9.be>
On 30 May 2012, at 01:56, Santiago Bragagnolo wrote:
Im looking for a log framework with configurable levels. Theres any stable and useful? I browsed the list and didn't find nothing but something like 'every body has its own logging framework'.
I wrote a small logging fwk for my project, but if is any more complete, it would be great.
There is one logging framework already in your image: Zinc-HTTP-Logging. It is based on Announcments. Although it is part of Zn, it is general purpose. What is special is that it logs the process ID as well, which is useful to debug multiprocess applications. See the Zn documentation for more info.
Sven
I would like a logging mechanism that manipulate objects that then are printed in various format. The compiler could use such logger I did not look at the code of toothpick probably extending LoggingEvent should do it. Stef On May 30, 2012, at 3:41 PM, Santiago Bragagnolo wrote:
Ok, i'll take what i need from the marianito's and zn and fork them in an other package, add what i need for massive loggin (like levels of loggin) and make a log-framework.
Any names? clairvoyant :3?
Then, is any easy aspect fwk that could i use for the logger? (sometimes i need just trace runtime, or i dont want to add a log line one by one) that works in pharo 2.0 ? :P?
2012/5/30 Sven Van Caekenberghe <sven@beta9.be>
On 30 May 2012, at 01:56, Santiago Bragagnolo wrote:
Im looking for a log framework with configurable levels. Theres any stable and useful? I browsed the list and didn't find nothing but something like 'every body has its own logging framework'.
I wrote a small logging fwk for my project, but if is any more complete, it would be great.
There is one logging framework already in your image: Zinc-HTTP-Logging. It is based on Announcments. Although it is part of Zn, it is general purpose. What is special is that it logs the process ID as well, which is useful to debug multiprocess applications. See the Zn documentation for more info.
Sven
Hi again Im already add several classes to the logger. http://ss3.gemstone.com/ss/PaulLePulp the way to use it still primitive, but is a nice draft. If you look at LogConfiguration configuration (class method) you'll find something like this self for:[ :builder | builder forClass:LogTestObject useLevel:#info showingLogAs: ('[%pid | %tstmp | %tag] #%class >> %selector' asPatternFormatter) into: Transcript asLogWriter retain:true. builder forKey:'default' useLevel:#error. ] then, with LogTestObject, if you send it "error", "warn" or "info", all you send there (blocks, strings, symbols or what-understand-value) will be showed at Transcript. (im didnt test on file or stdout yet) Finally retain:true adds the log to LogHolder, which responds to LogHolder instance select:[ :log | log whatYouWantToTest ]. Ill be testing tomorrow and fixing, but, if you want to see and advise me, you are welcome :) Ok, is 4am, im going to sleep 2012/5/30 Stéphane Ducasse <stephane.ducasse@inria.fr>
I would like a logging mechanism that manipulate objects that then are printed in various format. The compiler could use such logger
I did not look at the code of toothpick probably extending LoggingEvent should do it.
Stef
On May 30, 2012, at 3:41 PM, Santiago Bragagnolo wrote:
Ok, i'll take what i need from the marianito's and zn and fork them in an other package, add what i need for massive loggin (like levels of loggin) and make a log-framework.
Any names? clairvoyant :3?
Then, is any easy aspect fwk that could i use for the logger? (sometimes i need just trace runtime, or i dont want to add a log line one by one) that works in pharo 2.0 ? :P?
2012/5/30 Sven Van Caekenberghe <sven@beta9.be>
On 30 May 2012, at 01:56, Santiago Bragagnolo wrote:
Im looking for a log framework with configurable levels. Theres any stable and useful? I browsed the list and didn't find nothing but something like 'every body has its own logging framework'.
I wrote a small logging fwk for my project, but if is any more complete, it would be great.
There is one logging framework already in your image: Zinc-HTTP-Logging. It is based on Announcments. Although it is part of Zn, it is general purpose. What is special is that it logs the process ID as well, which is useful to debug multiprocess applications. See the Zn documentation for more info.
Sven
On Thu, May 31, 2012 at 9:21 AM, Santiago Bragagnolo < santiagobragagnolo@gmail.com> wrote:
Hi again
Im already add several classes to the logger.
http://ss3.gemstone.com/ss/PaulLePulp
the way to use it still primitive, but is a nice draft.
If you look at LogConfiguration configuration (class method) you'll find something like this
self for:[ :builder | builder forClass:LogTestObject useLevel:#info showingLogAs: ('[%pid | %tstmp | %tag] #%class >> %selector' asPatternFormatter)
nice :) into: Transcript asLogWriter
What if you want to configure multiple destinies? :D
retain:true.
builder forKey:'default' useLevel:#error. ]
What about moving the configuration elsewhere? :) Having to change the #configuration method every time is a pain in the ass.
then, with LogTestObject, if you send it "error", "warn" or "info", all you send there (blocks, strings, symbols or what-understand-value) will be showed at Transcript. (im didnt test on file or stdout yet)
Finally retain:true adds the log to LogHolder, which responds to LogHolder instance select:[ :log | log whatYouWantToTest ].
didn't get this #retain: part. Maybe I should have a look at the code.
Ill be testing tomorrow and fixing, but, if you want to see and advise me, you are welcome :)
And now you have another thing to post on your blog :3.
Ok, is 4am, im going to sleep
2012/5/30 Stéphane Ducasse <stephane.ducasse@inria.fr>
I would like a logging mechanism that manipulate objects that then are printed in various format. The compiler could use such logger
I did not look at the code of toothpick probably extending LoggingEvent should do it.
Stef
On May 30, 2012, at 3:41 PM, Santiago Bragagnolo wrote:
Ok, i'll take what i need from the marianito's and zn and fork them in an other package, add what i need for massive loggin (like levels of loggin) and make a log-framework.
Any names? clairvoyant :3?
Then, is any easy aspect fwk that could i use for the logger? (sometimes i need just trace runtime, or i dont want to add a log line one by one) that works in pharo 2.0 ? :P?
2012/5/30 Sven Van Caekenberghe <sven@beta9.be>
On 30 May 2012, at 01:56, Santiago Bragagnolo wrote:
Im looking for a log framework with configurable levels. Theres any stable and useful? I browsed the list and didn't find nothing but something like 'every body has its own logging framework'.
I wrote a small logging fwk for my project, but if is any more complete, it would be great.
There is one logging framework already in your image: Zinc-HTTP-Logging. It is based on Announcments. Although it is part of Zn, it is general purpose. What is special is that it logs the process ID as well, which is useful to debug multiprocess applications. See the Zn documentation for more info.
Sven
On Thu, May 31, 2012 at 11:50 AM, Guillermo Polito < guillermopolito@gmail.com> wrote:
On Thu, May 31, 2012 at 9:21 AM, Santiago Bragagnolo < santiagobragagnolo@gmail.com> wrote:
Hi again
Im already add several classes to the logger.
http://ss3.gemstone.com/ss/PaulLePulp
the way to use it still primitive, but is a nice draft.
If you look at LogConfiguration configuration (class method) you'll find something like this
self for:[ :builder | builder forClass:LogTestObject useLevel:#info showingLogAs: ('[%pid | %tstmp | %tag] #%class >> %selector' asPatternFormatter)
what do you mean by PID? Smalltalk processes do not have a PID. You could use identityHash but it could not even be unique. or is it the PID of the process running the VM?
then, with LogTestObject, if you send it "error", "warn" or "info", all
you send there (blocks, strings, symbols or what-understand-value) will be showed at Transcript. (im didnt test on file or stdout yet)
would be awesome to have the possibility to log into stdout also. -- Mariano http://marianopeck.wordpress.com
2012/5/31 Mariano Martinez Peck <marianopeck@gmail.com>
On Thu, May 31, 2012 at 11:50 AM, Guillermo Polito < guillermopolito@gmail.com> wrote:
On Thu, May 31, 2012 at 9:21 AM, Santiago Bragagnolo < santiagobragagnolo@gmail.com> wrote:
Hi again
Im already add several classes to the logger.
http://ss3.gemstone.com/ss/PaulLePulp
the way to use it still primitive, but is a nice draft.
If you look at LogConfiguration configuration (class method) you'll find something like this
self for:[ :builder | builder forClass:LogTestObject useLevel:#info showingLogAs: ('[%pid | %tstmp | %tag] #%class >> %selector' asPatternFormatter)
what do you mean by PID? Smalltalk processes do not have a PID. You could use identityHash but it could not even be unique. or is it the PID of the process running the VM?
*Yeah, is the Process identityHash! I called pid cause i get the logic from Zn logger. (as even the file writer and the stdout writter :) ). Must i call it PIH? Can i get the PID? is needed the pid in a log?*
then, with LogTestObject, if you send it "error", "warn" or "info", all
you send there (blocks, strings, symbols or what-understand-value) will be showed at Transcript. (im didnt test on file or stdout yet)
would be awesome to have the possibility to log into stdout also.
-- Mariano http://marianopeck.wordpress.com
Ok I' think i just need to add test and then is already usable. ( If you think i must add anything, just say it :)* * ) About last changes and configuration: The last add is pragma support: We have 2 pragmas configuration: <logConfiguration> That indicates the class method* *related know how to manage de log configuration There is support to usit this way: ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- configurationOfLog <logConfiguration> ^ [ :builder | builder forClass:LogTestObject useLevel:#info showingLogAs: ('%pih | %tstmp | %tag #%class >> %selector [%log]' asPatternFormatter) into: Transcript asLogWriter holdLogInstances:true. ]. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- and this way ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- configurationOfLog: builder <logConfiguration> builder forClass:LogTestObject useLevel:#info showingLogAs: ('%pih | %tstmp | %tag #%class >> %selector [%log]' asPatternFormatter) into: Transcript asLogWriter holdLogInstances:true. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- The other pragma is <logConfigurationAs:#aSymbol > This pragma says 'hey, forme use the #aSymbol configuration!', such as #default. then you can go to LogConfiguration >> configuration class method and add symbols with named configurations and relate with explicit classes with a simple pragma :) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- For other side, the manage of the 'if-the-class-has-not-configuration' is the same, search for the package configuration (that should be added in LogConfiguration >> configuration class method ), and if is not a package configuration, then go for the #default configuration. Tomorrow ill be adding tests and making a post on my blog with all the functionalities: Writers available (Memory, File, Stdout, Transcript, CompositeWriter) Formatters available (Pattern based -the one of the sample- SimpleFormatter and CustomFormatter) Filters available (the one who says how to decides if the log must be showed or just skiped -- CategoryFilter and LevelFilter. ) Holder ( an object which stores LogEntity objects - an object very much richier than the string stored for MemoryWriter) And ill add to the post how to write nice configurations with the existing code and, of course, how to add functionality in the way i thought the framework. *Again, the idea of this framework is to be used for all and have just one logger, so, please, if any one think i must add or change something, share it here. And if any wants to get his hands on the code the same, just say it. *
Hi all! Sorry for making you wait, here is the promised post about logger. http://concretetypeinference.blogspot.com.ar/2012/06/pharo-logger-aka-paul-o... Sorry for the awful text-format, blogger is really ugly. I'll be opening a wordpress blog and migrating all the posts the sooner as i can. Try to use it if you need a logger and please, send feedback! The needed code to addit to any project is really few, for an easy example, download the project and see at examples :). Santiago. 2012/6/1 Santiago Bragagnolo <santiagobragagnolo@gmail.com>
Ok
I' think i just need to add test and then is already usable. ( If you think i must add anything, just say it :)* * )
About last changes and configuration:
The last add is pragma support: We have 2 pragmas configuration:
<logConfiguration> That indicates the class method* *related know how to manage de log configuration
There is support to usit this way:
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- configurationOfLog <logConfiguration> ^ [
:builder | builder forClass:LogTestObject useLevel:#info showingLogAs: ('%pih | %tstmp | %tag #%class >> %selector [%log]' asPatternFormatter) into: Transcript asLogWriter holdLogInstances:true. ].
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
and this way
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- configurationOfLog: builder <logConfiguration>
builder forClass:LogTestObject useLevel:#info showingLogAs: ('%pih | %tstmp | %tag #%class >> %selector [%log]' asPatternFormatter) into: Transcript asLogWriter holdLogInstances:true.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The other pragma is <logConfigurationAs:#aSymbol >
This pragma says 'hey, forme use the #aSymbol configuration!', such as #default.
then you can go to
LogConfiguration >> configuration class method
and add symbols with named configurations and relate with explicit classes with a simple pragma :)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
For other side, the manage of the 'if-the-class-has-not-configuration' is the same, search for the package configuration (that should be added in LogConfiguration >> configuration class method ), and if is not a package configuration, then go for the #default configuration.
Tomorrow ill be adding tests and making a post on my blog with all the functionalities:
Writers available (Memory, File, Stdout, Transcript, CompositeWriter) Formatters available (Pattern based -the one of the sample- SimpleFormatter and CustomFormatter) Filters available (the one who says how to decides if the log must be showed or just skiped -- CategoryFilter and LevelFilter. ) Holder ( an object which stores LogEntity objects - an object very much richier than the string stored for MemoryWriter)
And ill add to the post how to write nice configurations with the existing code and, of course, how to add functionality in the way i thought the framework.
*Again, the idea of this framework is to be used for all and have just one logger, so, please, if any one think i must add or change something, share it here. And if any wants to get his hands on the code the same, just say it. *
2012/5/31 Guillermo Polito <guillermopolito@gmail.com>
On Thu, May 31, 2012 at 9:21 AM, Santiago Bragagnolo < santiagobragagnolo@gmail.com> wrote:
Hi again
Im already add several classes to the logger.
http://ss3.gemstone.com/ss/PaulLePulp
the way to use it still primitive, but is a nice draft.
If you look at LogConfiguration configuration (class method) you'll find something like this
self for:[ :builder | builder forClass:LogTestObject useLevel:#info showingLogAs: ('[%pid | %tstmp | %tag] #%class >> %selector' asPatternFormatter)
nice :)
into: Transcript asLogWriter
What if you want to configure multiple destinies? :D
* great idea, i just thogh about classes, packages and defaults. I'll add a class enumeration and a regular expression. (wait, finally it could be just regular expressions :3, with defaults)*
retain:true.
builder forKey:'default' useLevel:#error. ]
What about moving the configuration elsewhere? :) Having to change the #configuration method every time is a pain in the ass.
* yes yes, i know, its there cause i didnt think any better place :(. Im all ears. *
then, with LogTestObject, if you send it "error", "warn" or "info", all you send there (blocks, strings, symbols or what-understand-value) will be showed at Transcript. (im didnt test on file or stdout yet)
Finally retain:true adds the log to LogHolder, which responds to LogHolder instance select:[ :log | log whatYouWantToTest ].
didn't get this #retain: part. Maybe I should have a look at the code.
* The retain is a flag that say 'hey! i want that logObject to work with it later' then, it's stored on LogHolder instance collection. I'll refact later the mechanism to make a writer strategy of that LogHolder, but i need to extend my writers to a composite solution first, and think a cool way to compose them at configuration ( im all ears here too)*
Ill be testing tomorrow and fixing, but, if you want to see and advise me, you are welcome :)
And now you have another thing to post on your blog :3.
* Yeah :D *
Ok, is 4am, im going to sleep
2012/5/30 Stéphane Ducasse <stephane.ducasse@inria.fr>
I would like a logging mechanism that manipulate objects that then are printed in various format. The compiler could use such logger
I did not look at the code of toothpick probably extending LoggingEvent should do it.
Stef
On May 30, 2012, at 3:41 PM, Santiago Bragagnolo wrote:
Ok, i'll take what i need from the marianito's and zn and fork them in an other package, add what i need for massive loggin (like levels of loggin) and make a log-framework.
Any names? clairvoyant :3?
Then, is any easy aspect fwk that could i use for the logger? (sometimes i need just trace runtime, or i dont want to add a log line one by one) that works in pharo 2.0 ? :P?
2012/5/30 Sven Van Caekenberghe <sven@beta9.be>
On 30 May 2012, at 01:56, Santiago Bragagnolo wrote:
Im looking for a log framework with configurable levels. Theres any stable and useful? I browsed the list and didn't find nothing but something like 'every body has its own logging framework'.
I wrote a small logging fwk for my project, but if is any more complete, it would be great.
There is one logging framework already in your image: Zinc-HTTP-Logging. It is based on Announcments. Although it is part of Zn, it is general purpose. What is special is that it logs the process ID as well, which is useful to debug multiprocess applications. See the Zn documentation for more info.
Sven
On 30 May 2012 01:56, Santiago Bragagnolo <santiagobragagnolo@gmail.com>wrote:
Hi all.
Im looking for a log framework with configurable levels. Theres any stable and useful? I browsed the list and didn't find nothing but something like 'every body has its own logging framework'.
I wrote a small logging fwk for my project, but if is any more complete, it would be great.
I was pointed to toothpick once: http://www.metaprog.com/Toothpick/index.html It resembles log4j and I like the API, but last time I check it didn't work out of the box on Pharo. -- Milan Mimica http://sparklet.sf.net
participants (10)
-
Ben Coman -
Francois Stephany -
Gastón Dall' Oglio -
Guillermo Polito -
Marcus Denker -
Mariano Martinez Peck -
Milan Mimica -
Santiago Bragagnolo -
Stéphane Ducasse -
Sven Van Caekenberghe