I'm new to ruby environments, and I was looking for a good logging framework to use in my ruby and rails applications.
In my previous experiences, I successfully used log4j and log4p (perl port) and expected the same level of usability (and maturity) with log4r.
However, I must say that there are a number of things that are not entirely clear within log4r.
1 Registrar Inheritance
Logger inheritance is not managed at all!
If I declare a logger with the name "myapp" and then try to get the log name "myapp :: engine", the search will end using NameError.
I would expect the framework to return the root log according to the naming scheme and use the "myapp" logger.
Q1 . Of course, I can get around this and manage the names myself using the search method, but is there a cleaner way to do this without any extra coding?
2 YAML configuration
The second thing that bothers me is the configuration of the barley. There is literally no information on this system on the log4r website, the doc is linked forward to the missing pages, so all the information I can find is contained in the catalog of gem examples.
I was rather confused by the fact that the yaml configuration should contain a pre_config section and that I need to define my own levels.
If I delete pre_config secion or replace all "user" levels with standard ones (debug, info, warn, fatal), the following error will appear in the example:
log4r/yamlconfigurator.rb:68:in `decode_yaml': Log level must be in 0..7 (ArgumentError)
So it seems that there is no easy way to use a simple file in which we only declare registrars and applications for the framework.
Q2 : I really think that I missed something, and this should be a way to provide a simple file, a javelin file. Do you have any examples of this use?
3 Rearrange variables in an XML file
Q3 . Yaml's customization system seems to provide such a function, but I could not find a similar function with XML files. Any ideas?
4 alternatives?
I have to say that I am very disappointed with the level of function and maturity of log4r compared to log4j and other log4j ports.
I am in this framework with a solid background of registering APIs in other languages and find that I turn around in all kinds to make the “main things” run in the “real application”.
By this I mean a complex application consisting of several gems, console / script applications and the rails web web interface, where configuration is necessary and where we intensively use namespaces and inheritance.
I did a few searches to find something more suitable or mature, but did not find anything like it.
Q4 : Do you guys know any (serious) alternatives to the log4r structure that you can use in an enterprise-class application?
Thanks for reading all this!
I would really appreciate any pointers,
Respectfully,