You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@logging.apache.org by "Rony G. Flatscher (Apache)" <ro...@apache.org> on 2007/04/25 22:10:55 UTC
'log4r' - a new 'log4j' like framework about to be released ...
Hi there,
starting out with 'log4j', I have been creating a logging framework for
the scripting language "Open Object Rexx (ooRexx)" [cf.
<http://www.ooRexx.org>], dubbed "log4r".
It tries to stick to the 'log4j' architecture as closely as possible,
OTOH it tries to improve a few little things, like it allows for
creating named layouts and named filters, or using strictly
"log4r.config." as the lead-in string for all general configuration
options in properties files.
The initial implementation of the 'log4r' frameworks implements the
following classes:
* LogManager (can be used to create/retrieve loggers, appenders,
layouts, filters by name)
* LogLog (can be used by the framework classes for log messages)
* classes for creating loggers:
o Log
+ SimpleLog
+ NoOpLog
* classes for creating appenders:
o Appender
+ ConsoleAppender
+ FileAppender
# DailyRollingFileAppender
# RollingFileAppender
+ NullAppender
+ TelnetAppender
* classes for creating layouts
o Layout
+ PatternLayout
# HTMLLayout
# XMLLayout
+ SimpleLayout
* classes for creating filters
o Filter
+ DateRangeFilter
+ DenyAllFilter
+ LevelMatchFilter
+ LevelRangeFilter
+ MonthRangeFilter
+ StringMatchFilter
+ TimeRangeFilter
+ WeekdayRangeFilter
There will be an overview article which will demonstrate how to employ
the 'log4r' framework for ooRexx programs, a brief overview of the
architecture, of the classes, a documentation on defining configuration
entries in properties files.
The planned licenses are CPL 1.0 and Apache 2.0.
As I have created the framework being inspired by and adhering quite
closely to 'log4j', and seeing that comparable frameworks for other
programming languages exist and seem to be hosted/incorporated at/into
commons-logging, I am wondering, whether there would be interest in
adding the 'log4r' framework to the 'log4j' family of frameworks?
If I am using the wrong e-mail list, please let me know.
Very interested in your comments/hints.
Regards,
---rony
and two examples... (Re: Little update and additional infos on the
ooRexx implementation ... (Re: 'log4r' - a new 'log4j' like framework about
to be released ...
Posted by "Rony G. Flatscher (Apache)" <ro...@apache.org>.
Hi Curt,
>>> Seems like it may have already out-grown the labs phase. You
>>> apparently have a functioning code base and maybe the start of a
>>> community and applying to the incubator might be the appropriate
>>> action. Completing a Podling Proposal would be helpful to identify
>>> any issues.
>> Sorry, not being a native English speaker and not finding a translation,
>> may I just ask you what a "Podling Proposal" would be?
>
> A proposal for an incubator project (also known as a podling). A
> guide to proposal creation is available at
> http://incubator.apache.org/guides/proposal.html and an example is
> available at http://maven.apache.org/proposals/incubator/nmaven.html.
> You should also be familiar with the exit criteria for the incubator
> as described in
> http://incubator.apache.org/incubation/Incubation_Policy.html#Minimum+Exit+Requirements.
>
Thank you very much for your kind explanations and links!
> I think that you should avoid the name log4r regardless of the
> ultimate home for the framework.
Yes, I will rename the package to "log4rexx".
> Logging Services would be most appropriate ultimate home for log4r
> within Apache. I don't know ooRexx community at all, so I can't judge
> your other options. Here are the pros and cons with hosting the
> project at Apache:
>
> Pros:
>
> 1. Established community and customs
> 2. Potential cross-pollination with log4j, log4cxx and log4net
> 3. Apache license
>
> Cons:
>
> 1. Unable to formally release until graduation from incubator
> 2. Incubator exit criteria of 3 independent committers may be hard to
> achieve and maintain
> 3. No established ooRexx community (as far as I know)
The ooRexx community is rather small at this time (it draws mostly from
the established, albeit largely unknown Rexx community). There are a few
ooRexx developers who are contemplating of employing the framework with
the intent to enhance it to meet their own needs here and there.
However, it may be a good idea to "wait and see" how it picks up (i.e.,
"planting" it in the ooRexx community) and come back later. I will try
to make sure that from a licensing point of view each addition from
others carries the Apache license as well to keep the option.
> I was not suggesting implementing log4r in Java. The design goal in
> all the log4X frameworks has been to minimize the cost of logging when
> disabled to the absolute minimum, ideally as little as an integer
> compare.
Yes, tried to keep that principle with the ooRexx implementation.
> Switching between languages is usually much more expensive.
Definitely! Especially, if matching Jaa with a dynamic(ally typed)
language that gets interpreted like ooRexx. [The hardware has become so
powerful it seems, that for all practical purposes, this switching has
become feasible. And the hardware has been still growing more and more
powerful.]
> What I was suggesting is that you know what the syntax would be for
> calling log4j over the ooRexx-Java bridge and consider that your users
> might want to be able to migrate from log4r to log4j over the bridge
> if they need a feature not in log4r or if they are running within the
> context that is already using log4j.
Hmm, interesting question! (I cannot believe that I have never tried
that out while developing log4r, so the following two little examples
are a premiere for me as well!)
The following two ooRexx programs were run with Java 1.5 and
"logging-log4j-1.2.13.jar" (ooRexx version 3.1.2 with the BSF4Rexx
package). This execution was under Windows, but could also have been run
e.g. on Linux (or MacOSX).
You may want to know:
* the tilde (~) is an explicit message operator, the name right of
it is always the name of the message; conceptually ooRexx will go
and look for a method by the same name of the message, using its
inheritance/classifcation tree for lookup,
* ooRexx is *not* case-sensitive (actually everything outside of
quotes is uppercased before the Rexx statement gets interpreted),
* ooRexx class objects can be accessed by using the class name
prepended with a dot; it is possible with BSF4Rexx to import a
Java class object and thereafter interact with it as if it was an
ooRexx (proxy) class object,
* attribute assignments in ooRexx are usually carried out by sending
the name of the attribute to the object followed by an equal sign,
followed by an expression which value gets assigned to the
attribute; querying an attribute value is as easy as sending the
name of the attribute to the object. This behaviour would also be
available for accessing/setting Java fields via BSF4Rexx.
Example 1: demonstrate how to access the log4j rootLogger and use it to
log messages to it:
Logger=bsf.loadClass("org.apache.log4j.Logger") /* get the Java class object */
r=Logger~getRootLogger /* get the rootLogger */
say "rootLogger's level:" r~level~toString /* get the string value of the Level object */
/* use the rootLogger */
r~trace("Using the 'log4j' rootLogger, method 'trace'")
r~debug("Using the 'log4j' rootLogger, method 'debug'")
r~info("Using the 'log4j' rootLogger, method 'info'")
r~warn("Using the 'log4j' rootLogger, method 'warn'")
r~error("Using the 'log4j' rootLogger, method 'error'")
r~fatal("Using the 'log4j' rootLogger, method 'fatal'")
::requires bsf.cls /* get the BSF support */
The output of the program ("testlog4j.rex") above yields:
F:\tmp\logging-log4j-1.2.13\dist\lib>testlog4j.rex
rootLogger's level: FATAL
FATAL - Using the 'log4j' rootLogger, method 'fatal'
Example 2: transcription of the example from the log4j documentation
file "manual.html" which got copied and pasted, and finally edited to
turn it into an ooRexx program:
-- import the Java class objects we need in ooRexx, this time
-- we want to access the Java class objects via ooRexx (proxy)
-- class objects (which get a dot prepended to the class name)
call bsf.import "org.apache.log4j.Logger", "Logger"
call bsf.import "org.apache.log4j.Level", "Level"
-- get a logger instance named "com.foo"
logger = .Logger~getLogger("com.foo")
-- Now set its level. Normally you do not need to set the
-- level of a logger programmatically. This is usually done
-- in configuration files.
logger~setLevel(.Level~INFO)
-- can also be stated as an ooRexx attribute assignment:
logger~level=.level~info
barlogger = .Logger~getLogger("com.foo.Bar")
-- This request is enabled, because WARN >= INFO.
logger~warn("Low fuel level.");
-- This request is disabled, because DEBUG < INFO.
logger~debug("Starting search for nearest gas station.");
-- The logger instance barlogger, named "com.foo.Bar",
-- will inherit its level from the logger named
-- "com.foo" Thus, the following request is enabled
-- because INFO >= INFO.
barlogger~info("Located nearest gas station.");
-- This request is disabled, because DEBUG < INFO.
barlogger~debug("Exiting gas station search");
::requires bsf.cls /* get the BSF support */
The output of the program ("testlog4j.rex") above yields:
F:\tmp\logging-log4j-1.2.13\dist\lib>testlog4j-2.rex
WARN - Low fuel level.
INFO - Located nearest gas station.
Loading the above two ooRexx programs into the vim editor would syntax
highlight them, making it easier to immediately spot the comments, the
code with the keywords and operators highlighted.
If you have any questions, please ask!
Regards,
---rony
Re: Little update and additional infos on the ooRexx implementation ... (Re: 'log4r' - a new 'log4j' like framework about to be released ...
Posted by Curt Arnold <ca...@apache.org>.
On May 14, 2007, at 5:49 PM, Rony G. Flatscher (Apache) wrote:
> Hi Curt,
>> Seems like it may have already out-grown the labs phase. You
>> apparently have a functioning code base and maybe the start of a
>> community and applying to the incubator might be the appropriate
>> action. Completing a Podling Proposal would be helpful to identify
>> any issues.
> Sorry, not being a native English speaker and not finding a
> translation,
> may I just ask you what a "Podling Proposal" would be?
A proposal for an incubator project (also known as a podling). A
guide to proposal creation is available at http://
incubator.apache.org/guides/proposal.html and an example is available
at http://maven.apache.org/proposals/incubator/nmaven.html. You
should also be familiar with the exit criteria for the incubator as
described in http://incubator.apache.org/incubation/
Incubation_Policy.html#Minimum+Exit+Requirements.
>
>> Seems like ooRexx has a established legal and development
>> framework in
>> which you are a significant participant. Is there a reason that
>> Apache would be a better home for log4r?
> Well, seeing that commons is going TLP and possibly removing its
> ties to
> Java, I thought it might be a good idea to have comparable
> implementations to the log4j architecture put untder the commons
> umbrella. OTOH, it would be possible and feasible to submit the
> current
> implentation to the opensource ooRexx project's incubator.
>
> If you think that it would be better for the project to submit it
> to the
> ooRexx projec (and maybe have a link or infos about an ooRexx
> implementation of the log4j architecture), I would do so. (If done so,
> would you think that the term "log4r" would be still confusing with
> the
> Ruby implementation?)
I think that you should avoid the name log4r regardless of the
ultimate home for the framework.
Logging Services would be most appropriate ultimate home for log4r
within Apache. I don't know ooRexx community at all, so I can't
judge your other options. Here are the pros and cons with hosting
the project at Apache:
Pros:
1. Established community and customs
2. Potential cross-pollination with log4j, log4cxx and log4net
3. Apache license
Cons:
1. Unable to formally release until graduation from incubator
2. Incubator exit criteria of 3 independent committers may be hard to
achieve and maintain
3. No established ooRexx community (as far as I know)
>
>> On a technical side, it appears that you were involved in the
>> development of an ooRexx/Java bridge as part of Apache BSF. Does the
>> use of log4r resemble the use of log4j over the bridge?
> No, log4r as it stands now is a stand-alone, pure ooRexx
> implementation.
> It would be feasible in general, however, to take advantage of log4j
> itself using the ooRexx bridge for Apache BSF (but that is a totally
> different use-case making ooRexx dependent on Java, which nowadays -
> practically every computer has a JRE installed - may not be a
> hindering
> stone anymore).
I was not suggesting implementing log4r in Java. The design goal in
all the log4X frameworks has been to minimize the cost of logging
when disabled to the absolute minimum, ideally as little as an
integer compare. Switching between languages is usually much more
expensive.
What I was suggesting is that you know what the syntax would be for
calling log4j over the ooRexx-Java bridge and consider that your
users might want to be able to migrate from log4r to log4j over the
bridge if they need a feature not in log4r or if they are running
within the context that is already using log4j.
Re: Little update and additional infos on the ooRexx implementation
... (Re: 'log4r' - a new 'log4j' like framework about to be released ...
Posted by "Rony G. Flatscher (Apache)" <ro...@apache.org>.
Hi Curt,
> Seems like it may have already out-grown the labs phase. You
> apparently have a functioning code base and maybe the start of a
> community and applying to the incubator might be the appropriate
> action. Completing a Podling Proposal would be helpful to identify
> any issues.
Sorry, not being a native English speaker and not finding a translation,
may I just ask you what a "Podling Proposal" would be?
> Seems like ooRexx has a established legal and development framework in
> which you are a significant participant. Is there a reason that
> Apache would be a better home for log4r?
Well, seeing that commons is going TLP and possibly removing its ties to
Java, I thought it might be a good idea to have comparable
implementations to the log4j architecture put untder the commons
umbrella. OTOH, it would be possible and feasible to submit the current
implentation to the opensource ooRexx project's incubator.
If you think that it would be better for the project to submit it to the
ooRexx projec (and maybe have a link or infos about an ooRexx
implementation of the log4j architecture), I would do so. (If done so,
would you think that the term "log4r" would be still confusing with the
Ruby implementation?)
> On a technical side, it appears that you were involved in the
> development of an ooRexx/Java bridge as part of Apache BSF. Does the
> use of log4r resemble the use of log4j over the bridge?
No, log4r as it stands now is a stand-alone, pure ooRexx implementation.
It would be feasible in general, however, to take advantage of log4j
itself using the ooRexx bridge for Apache BSF (but that is a totally
different use-case making ooRexx dependent on Java, which nowadays -
practically every computer has a JRE installed - may not be a hindering
stone anymore).
Regards,
---rony
Re: Little update and additional infos on the ooRexx implementation ... (Re: 'log4r' - a new 'log4j' like framework about to be released ...
Posted by Curt Arnold <ca...@apache.org>.
On May 14, 2007, at 2:09 AM, Rony G. Flatscher (Apache) wrote:
> Hi Curt,
>
> in the meantime I could present the framework to the Rexx community
> at this year's International symposium and there seems to be
> interest in it. Therefore I plan to publish it via apache labs.
> One of the things to solve beforehand would be to the name, which
> at the moment is set to "log4r", which - as you pointed out - has
> been taken by the Ruby implementation. Therefore I have been
> contemplating to name it either "log4o" (short for: "log4ooRexx")
> or "log4rexx", both names seem to be "free".
>
> The following URLs point to the slides and overview article of the
> framework, containing nutshell examples in ooRexx (the tilde
> character is an explicit message operator in ooRexx, hence the name
> right of a tilde is always a message name; in case a message
> carries arguments they are given as a comma-separated list in round
> parenthesis immediately following the message name):
> <http://wi.wu-wien.ac.at/rgf/rexx/orx18/log4r/
> 2007_orx18_log4r.pdf>, slides
> <http://wi.wu-wien.ac.at/rgf/rexx/orx18/log4r/2007_orx18_log4r-
> article.pdf>, brief overview article
> <http://wi.wu-wien.ac.at/rgf/rexx/orx18/log4r/log4r_20070425.zip>,
> (source of) the framework; use "vim" or "gvim" to get the ooRexx
> syntax highlighting to ease reading
> <http://prog.vub.ac.be/~wdmeuter/RDL06/Flatscher.pdf>, brief
> overview article of ooRexx, stressing its history, easy syntax
> (almost pseudo-code like) and its "human-centric" philosophy
> A last remark ad asynchronously processing log messages: as it is
> very easy in ooRexx to start and stop multithreading at any time,
> an environment symbol is used to control this feature: this will
> cause the processing of log messages themselves to be carried out
> in a multithreaded fashion. Hence the appenders themselves need not
> to execute asyncrhoneously themselves (although they could in
> addition do that as well).
>
> So if the package name 'log4o' or 'log4rexx' sound reasonable (and
> not name-clashing) I would plan to introduce it into the Apache
> realm...
>
> Regards,
>
> ---rony
>
Seems like it may have already out-grown the labs phase. You
apparently have a functioning code base and maybe the start of a
community and applying to the incubator might be the appropriate
action. Completing a Podling Proposal would be helpful to identify
any issues.
Seems like ooRexx has a established legal and development framework
in which you are a significant participant. Is there a reason that
Apache would be a better home for log4r?
On a technical side, it appears that you were involved in the
development of an ooRexx/Java bridge as part of Apache BSF. Does the
use of log4r resemble the use of log4j over the bridge?
Little update and additional infos on the ooRexx implementation ...
(Re: 'log4r' - a new 'log4j' like framework about to be released ...
Posted by "Rony G. Flatscher (Apache)" <ro...@apache.org>.
Hi Curt,
in the meantime I could present the framework to the Rexx community at
this year's International symposium and there seems to be interest in
it. Therefore I plan to publish it via apache labs. One of the things
to solve beforehand would be to the name, which at the moment is set to
"log4r", which - as you pointed out - has been taken by the Ruby
implementation. Therefore I have been contemplating to name it either
"log4o" (short for: "log4ooRexx") or "log4rexx", both names seem to be
"free".
The following URLs point to the slides and overview article of the
framework, containing nutshell examples in ooRexx (the tilde character
is an explicit message operator in ooRexx, hence the name right of a
tilde is always a message name; in case a message carries arguments they
are given as a comma-separated list in round parenthesis immediately
following the message name):
* <http://wi.wu-wien.ac.at/rgf/rexx/orx18/log4r/2007_orx18_log4r.pdf>,
slides
* <http://wi.wu-wien.ac.at/rgf/rexx/orx18/log4r/2007_orx18_log4r-article.pdf>,
brief overview article
* <http://wi.wu-wien.ac.at/rgf/rexx/orx18/log4r/log4r_20070425.zip>,
(source of) the framework; use "vim" or "gvim" to get the ooRexx
syntax highlighting to ease reading
* <http://prog.vub.ac.be/~wdmeuter/RDL06/Flatscher.pdf>, brief
overview article of ooRexx, stressing its history, easy syntax
(almost pseudo-code like) and its "human-centric" philosophy
A last remark ad asynchronously processing log messages: as it is very
easy in ooRexx to start and stop multithreading at any time, an
environment symbol is used to control this feature: this will cause the
processing of log messages themselves to be carried out in a
multithreaded fashion. Hence the appenders themselves need not to
execute asyncrhoneously themselves (although they could in addition do
that as well).
So if the package name 'log4o' or 'log4rexx' sound reasonable (and not
name-clashing) I would plan to introduce it into the Apache realm...
Regards,
---rony
Re: 'log4r' - a new 'log4j' like framework about to be released ...
Posted by "Rony G. Flatscher (Apache)" <ro...@apache.org>.
Hi Curt,
thank you very much for your feedback, hints and explanations!
... cut ...
>> dubbed "log4r".
> There is already a log4r which is a log4j-like logging framework for
> Ruby (http://log4r.sourceforge.net).
Oh, I was not aware of that!
> There are two different things that you might be suggesting and they
> are substantially different. One is to add your log4r to the list of
> third-party logging inspired by frameworks that we maintain on the
> logging.apache.org site. There should be no difficulty on that other
> than the inertia of our web-site maintenance (and there is some light
> at the end of the tunnel on addressing that).
Fine.
> The second is to have log4r to become part of the ASF Logging Services
> project. There has been an interest in logging frameworks for
> scripting languages within the project and I would expect the PMC
> would be receptive to a project that wanted to come in that had a good
> likelihood of developing a viable developer and user community.
> However, the incubation of log4php was recently terminated due to a
> failure to grow beyond the original author.
Interesting!
> Since the existing work was done outside of a community, it would need
> to go through the incubation process (http://incubator.apache.org)
> before entering logging services proper. I'm thinking that the
> recently formed Apache Labs (http://labs.apache.org) might be a good
> place to start particularly if you think that log4r might become a
> candidate to go through the incubation process. That would
> significantly reduce all the legal issues involved with getting CLA's
> for all the contributors etc on an eventual trip through the
> incubator. Since you have an @apache.org email address, likely you
> could start a lab with little or no effort.
Will look into this, thanks for the lab idea, which sounds very sound!
;) Ad license: as I am the only one at the moment, there is no problem.
Going through a lab of course would make sure that the project (and
possible enhancements, additions) are bound to the ASF license.
> The dual licensing would become an issue when you have contributions
> from others. You would retain the copyright of all code that you
> write and can license it as many ways as you would like, but you would
> not automatically be granted rights to distribute contributes from
> others under any other license than the ASL.
Right, mostlikely the CPL is not really needed (there is the yearly
International Rexx symposium taking place next week in Florida, where I
will discuss this particular point; AFIAK the ASF license would be
compatibel to the CPL one that ooRexx is created under, such that I
could probably remove the CPL one.
---
Will be "off" for a few weeks (travel, looking about the adoption of
the present log4r framework, which gets introduced next week to the Rexx
community, and checking out the interest of the ooRexx community in
further extending the present framework, such that estimating the
building of a community can be at least vaguely estimated).
Again, Curt, thank you very much for your feedback, explanations and ideas!
Regards,
---rony
Re: 'log4r' - a new 'log4j' like framework about to be released ...
Posted by Curt Arnold <ca...@apache.org>.
On Apr 25, 2007, at 3:10 PM, Rony G. Flatscher (Apache) wrote:
> Hi there,
>
> starting out with 'log4j', I have been creating a logging framework
> for the scripting language "Open Object Rexx (ooRexx)" [cf. <http://
> www.ooRexx.org>], dubbed "log4r".
>
There is already a log4r which is a log4j-like logging framework for
Ruby (http://log4r.sourceforge.net).
> It tries to stick to the 'log4j' architecture as closely as
> possible, OTOH it tries to improve a few little things, like it
> allows for creating named layouts and named filters, or using
> strictly "log4r.config." as the lead-in string for all general
> configuration options in properties files.
>
> There will be an overview article which will demonstrate how to
> employ the 'log4r' framework for ooRexx programs, a brief overview
> of the architecture, of the classes, a documentation on defining
> configuration entries in properties files.
>
> The planned licenses are CPL 1.0 and Apache 2.0.
>
> As I have created the framework being inspired by and adhering
> quite closely to 'log4j', and seeing that comparable frameworks for
> other programming languages exist and seem to be hosted/
> incorporated at/into commons-logging, I am wondering, whether there
> would be interest in adding the 'log4r' framework to the 'log4j'
> family of frameworks?
>
There are two different things that you might be suggesting and they
are substantially different. One is to add your log4r to the list of
third-party logging inspired by frameworks that we maintain on the
logging.apache.org site. There should be no difficulty on that other
than the inertia of our web-site maintenance (and there is some light
at the end of the tunnel on addressing that).
The second is to have log4r to become part of the ASF Logging
Services project. There has been an interest in logging frameworks
for scripting languages within the project and I would expect the PMC
would be receptive to a project that wanted to come in that had a
good likelihood of developing a viable developer and user community.
However, the incubation of log4php was recently terminated due to a
failure to grow beyond the original author.
Since the existing work was done outside of a community, it would
need to go through the incubation process (http://
incubator.apache.org) before entering logging services proper. I'm
thinking that the recently formed Apache Labs (http://
labs.apache.org) might be a good place to start particularly if you
think that log4r might become a candidate to go through the
incubation process. That would significantly reduce all the legal
issues involved with getting CLA's for all the contributors etc on an
eventual trip through the incubator. Since you have an @apache.org
email address, likely you could start a lab with little or no effort.
The dual licensing would become an issue when you have contributions
from others. You would retain the copyright of all code that you
write and can license it as many ways as you would like, but you
would not automatically be granted rights to distribute contributes
from others under any other license than the ASL.
> If I am using the wrong e-mail list, please let me know.
This is the right list for these types of discussions.