So am I to understand that I cannot use LogFilePatternReceiver in process Y to receive messages from RollingFileAppender in process X as events are written to the log file from process X? It would seem to me that the receiver should allow me to dispatch the log messages it receives using a special appender that I create to pass the information around my application, much like the ChainsawAppender and ChainsawAppenderHandler work together.
Am I correct? Thanks, Matt Paul Smith-2 wrote: > >> >> I'm trying to use the log4j Receivers to bring the logging events >> that post >> to those files (or any type of receiver (appender?, let me know if I'm >> getting the terminology wrong)) back into my system to handle them. >> I need >> to grab the events as the Receiver gets them so I can convert them >> into my >> domain objects and do what I need with them. It would be helpful if >> there >> were some event hooks that I could use for when a log message is >> received, >> but I haven't been able to find anything yet. >> > > First question, the logs that are being generated presumably come from > a JVM process, say, Process X. Are you doing the analysis in a > separate process (Process Y)? Or will the analysis be done _within_ > Process X? > > If you want a separate process doing the analysis then you need to have: > > * An appender that transmits the events out of the source process > (Process X) to a separate process (e.g. Process Y). This can be > accomplished by using a SocketAppender in project X configured to > point to the details of Process Y. Inside Process Y, you configure a > matching SocketReceiver with matching configs. Now when Process X and > Y are running, logging events are transmitted between them. The > SocketReceiver accepts the events and simply posts them to the local > log4j event bus. You can then create a custom Appender implementation > that accepts these events for processing running inside Process Y. > > If you want to do the analysis inside the event generating process > (everything inside Process X), then you can create the custom Appender > as described before and simply configure it like a normal appender. > there is no need to use a Receiver in this case at all. > > Hope this helps. > > Paul > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Handling-Logging-Events-Directly-tp15425126p15434489.html Sent from the Log4j - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
