Hi Jeff,
By default, the configurator will create
Category objects of the default type.
Have you told the configurator to create instances of
your custom Category? If not, and you are (elsewhere)
trying to cast this Category object to your custom class
then it will generate a ClassCastExceptio
> it to some EJB objects, and I don't mind if a message gets lost here or
> there The app doesn't get a lot of use, so the chances of two
> people/processes trying to write to the same file is fairly low
>
> So, does the logger fail cleanly, or does it fail mess
In the source distribution, see:
org/apache/log4j/xml/examples/sample4.xml
Cheers,
Simon
> -Original Message-
> From: Peter Lin [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, February 27, 2001 9:43 PM
> To: [EMAIL PROTECTED]
> Subject: async appender question
>
>
> Is there an exam
a method call in the EJB's that does a
> URLConnection and pass the message off to a Servlet which could handle
> logging the message to a FileAppender. That way, I could retain the layout
> and use the FileAppender.
>
> Would this concept be a problem?
>
>
>
>
Hi John,
It has been mentioned several times
on this list that the FileAppender really
shouldn't be used for EJB development.
FileAppender isn't designed for
multiple processes writing to the
same file, and (as you have seen)
there are also security/access issues
with creating a file on disk.
Hi Sushil,
As far as I know there is no such log4j feature
as you describe in your email.
If you want to implement it, here is a suggestion
about how I would do it (no promises this is the
best way!).
I would create a new Filter class which keeps a
FIFO queue of references to the last N message
>say 3 appenders - console, file and NTEventLog and I wanna log debug and
> >info to console, info and warning to file and Error and fatal messages to
> >NTEventLog then how do we organise these things with XML file and also
> with
> >source.
[Kitching Simon]
n
> appserver successfully.
>
> Is this because some appservers are very relaxed about enforcing the
> standards on classes used by EJBs? I'm really thinking of the
> synchronization that log4j does, which shouldn't really be 'allowed'
> when called from an EJB.
rmation
> to a central JMS queue. A central listener would then get all of the log
> messages, and log them to file, etc.
[Kitching Simon]
That seems to be a reasonable approach to me.
You may wish to look into using AsyncAppender as a "wrapper"
a
Hi Chris,
Have a look at the "configureAndWatch" methods
on DOMConfigurator and PropertyConfigurator..
Regards,
Simon
> -Original Message-
> From: Chris Gunn [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, February 16, 2001 5:17 PM
> To: [EMAIL PROTECTED]
> Subject: Changing Categor
Hi Geert,
With a simple check, you can see where the "trax" classes are used from:
[venus]/home/skitchin/loghack/jakarta-log4j/org-> find . -name "*.java"
-exec grep trax {} \; -print
import org.apache.trax.Processor;
import org.apache.trax.TemplatesBuilder;
import org.apache.trax.Templates;
imp
tegory.fred = com.acme.Priority#TRACE, appender1
>
> Simon:
>
> Is this patch you talk about (see above) the same as the use-a-wrapper
> workaround you sent on the mailing list an hour ago?
>
[Kitching Simon]
No, the two subjects (priority patch, Cate
Hi Jim,
Nice to see there *are* people using custom
Priorities .. I thought I was alone for a while!
Just a few comments:
(a)
with this approach, the custom category needs
to be used like this:
TraceableCategory cat = (TraceableCategory)
TraceableCategory.getInstance("catname");
cat.trac
Hi Geert,
This all sounds very familiar - been there!
An alternative approach to creating a new Category class,
and all the related gumph is to create a *wrapper* for
Category that knows about the custom priorities.
Advantages:
(a) no casting
(b) no need for custom CategoryFactory, etc.
(c) mos
Hi Julie,
If your code writes to a category, then that category "exists",
whether it is defined in the configuration file or not.
What you can do is set up the configuration file so that
the logging level of the category is so high that all
messages get discarded, which I think is what you
are
Hi Otis,
Re your comment
>Reading about AsyncAppender made me want to switch to it from FileAppender.
AsyncAppender isn't a complete appender;
it is a "wrapper" that can be placed around
another appender. The AsyncAppender is
configured with an appender instance (eg
an instance of JMSAppender).
Hi Michiel,
The benefit of the AsyncAppender is not that logging
runs faster (ie log messages get written to disk faster),
but that code which *calls* log methods runs faster,
because it does not wait for the logged message to
be written.
In order to prove this, what you need is a very slow Appe
How about using the AsyncAppender in combination with the JMSAppender?
This seems to be just what it was designed for.
> -Original Message-
> From: Roger Kjensrud [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, February 07, 2001 8:16 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subje
Is there a way to configure an xml configuration file
so that the threshold of an appender gets set?
Thanks,
Simon
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
On a similar thread, I'm busy working on a DatagramAppender
class, mainly by ripping off the SyslogAppender class :-)
The basic problem I have is an applet embedded in an intranet
web page. I want this applet to be able to log issues to a
central file, no matter what workstations it is running o
Hi David,
How about subclassing the appender (eg FileAppender) class
to check the threadid against some table to determine the
destination to write the output to?
For example, if your threads are in different thread-groups,
then the FileAppender could check it's threadgroup, and
output to a thr
21 matches
Mail list logo