Hello Sir am new in log4j.
My Requirements is to receive the log Statements without changing log4j properties.
how can i receive the log Statements?
Kindly reply me
ThankYou
Printable View
Hello Sir am new in log4j.
My Requirements is to receive the log Statements without changing log4j properties.
how can i receive the log Statements?
Kindly reply me
ThankYou
1. Don't double post the same question, and don't use the browser's back button to edit your posts, as that creates multiple postings.
2. Post in an appropriate forum. Your question is in no way a 'Java Announcement'.
db
What do you mean by "receive the Statements"?
i want to get the log Statements without using log 4j properties
Have some reading here : log4j 1.2. See if that can give you some hint.
Or tell us what you need exactly and show us where have you stuck up with what?
Goldest
So you want to intercept the calls to the various log() methods somehow?
Actually My Application is in Wowza server, when server is started the log statements are written in log fields... At the Same time i want to get the log Details..Any coding to receive the log details?
First guide me how to get the log Statements
"Wowza server"?
Without changing the settings for log4j to direct logging to somewhere you can intercept it I can't think of anyway to do this. Is this logging that isn't part of your app or something? If it's part of your app then change how you do logging, maybe using a wrapper around the logger which does the intrerceptig. But then if you can do that, then why not simply change the log4j settings...
ya its like Tomcat.
i want to receive the log Statements(client side) and Send it through the webservice to my server side...My problem is to receive the log Statements..Changing properties is not possible ,and i cant use Udp Appender..is it possible to receive the log Statements by java coding?
I don't know what you expect to be able to do in code, because unless you change how log4j works how do you expect to intercept the messages?
By saying you can't change the log5j setup, or add an appender, you are essentially saying "how can I change where log4j sends logs without changing anything".
Am Asking suppose,Date is one of the Log fields if i want the date logfields Am doing like this .
date = (String)WMSLoggerFactory.getGlobalLogValue(WMSLogg erIDs.FD_date);
System.out.println(" date is "+ date);
output Also Came..
Similar That Is any other way to get the log details..This coding is working only Date Time ...
What is WMSLoggerFactory?
That's not part of log4j...is it an implementation of LoggerFactory?
Is it a Wowza thing?
If so then I would suggest asking at a Wowza forum.
OK leave wowza
Normally in log4j is it possible to get the log fields By Manual Implementation without using property changes..
kindly reply me sir
i Struck up to get the log details...kindly guide me
No you can't get the log details.
If by "log details" you mean the messages passed into the various log() calls.
Those messages are passed onto the assigned appenders and then forgotten about.
Now, and appender may stick the messages anywhere, but log4j does not remember them.
So, as I said earlier on, you will have to either wrap log4j Loggers so that you can intercept the log() calls and then do something with the messages or add an appender that does your web service call for you. The second is the usual technique.
How can i wrap the log4j loggers can you explain me with Example with detail sir?
You'd have to write your own LoggerFactory, that returned Loggers that did what you wanted.
Of course that would probably also involve setting up log4j to use that factory.
Or change all your logging code to use your factory directly, I suppose.
This is a basic forum here...there's no way I can spend the time to actually write your code for you.
Still don't understand why you can't simply create an appender.
Anything else is just nonsense.
Thank you sir