Results 1 to 20 of 20
Like Tree1Likes
  • 1 Post By DarrylBurke

Thread: To receive the Log Statements

  1. #1
    nirasiva is offline Member
    Join Date
    May 2011
    Location
    chennai
    Posts
    29
    Rep Power
    0

    Exclamation To receive the Log Statements

    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

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,193
    Rep Power
    19

    Default

    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
    nirasiva likes this.

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default

    What do you mean by "receive the Statements"?

  4. #4
    nirasiva is offline Member
    Join Date
    May 2011
    Location
    chennai
    Posts
    29
    Rep Power
    0

    Default

    i want to get the log Statements without using log 4j properties

  5. #5
    goldest's Avatar
    goldest is offline Senior Member
    Join Date
    Oct 2009
    Location
    Pune, India
    Posts
    469
    Rep Power
    5

    Cool

    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
    Java Is A Funny Language... Really!
    Click on * and add to member reputation, if you find their advices/solutions effective.

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default

    So you want to intercept the calls to the various log() methods somehow?

  7. #7
    nirasiva is offline Member
    Join Date
    May 2011
    Location
    chennai
    Posts
    29
    Rep Power
    0

    Default

    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?
    Last edited by nirasiva; 06-02-2011 at 10:54 AM. Reason: My post is make some mistake

  8. #8
    nirasiva is offline Member
    Join Date
    May 2011
    Location
    chennai
    Posts
    29
    Rep Power
    0

    Default

    First guide me how to get the log Statements

  9. #9
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default

    "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...

  10. #10
    nirasiva is offline Member
    Join Date
    May 2011
    Location
    chennai
    Posts
    29
    Rep Power
    0

    Default

    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?
    Last edited by nirasiva; 06-02-2011 at 11:11 AM. Reason: My post is make some mistake

  11. #11
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default

    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".

  12. #12
    nirasiva is offline Member
    Join Date
    May 2011
    Location
    chennai
    Posts
    29
    Rep Power
    0

    Default

    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 ...

  13. #13
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default

    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.

  14. #14
    nirasiva is offline Member
    Join Date
    May 2011
    Location
    chennai
    Posts
    29
    Rep Power
    0

    Default

    OK leave wowza
    Normally in log4j is it possible to get the log fields By Manual Implementation without using property changes..

  15. #15
    nirasiva is offline Member
    Join Date
    May 2011
    Location
    chennai
    Posts
    29
    Rep Power
    0

    Default

    kindly reply me sir

  16. #16
    nirasiva is offline Member
    Join Date
    May 2011
    Location
    chennai
    Posts
    29
    Rep Power
    0

    Default

    i Struck up to get the log details...kindly guide me

  17. #17
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default

    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.

  18. #18
    nirasiva is offline Member
    Join Date
    May 2011
    Location
    chennai
    Posts
    29
    Rep Power
    0

    Default

    How can i wrap the log4j loggers can you explain me with Example with detail sir?

  19. #19
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default

    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.

  20. #20
    nirasiva is offline Member
    Join Date
    May 2011
    Location
    chennai
    Posts
    29
    Rep Power
    0

Similar Threads

  1. not able to receive packets?? pls help.
    By abdullahansari in forum New To Java
    Replies: 1
    Last Post: 06-24-2010, 02:19 AM
  2. UDP Receive Problem
    By Debbie in forum Networking
    Replies: 0
    Last Post: 04-27-2010, 10:56 AM
  3. How to receive mail using JMS
    By ashoksaravanan in forum Web Frameworks
    Replies: 1
    Last Post: 02-22-2010, 10:11 AM
  4. How to send and receive SMS to and from JSP
    By ashrafraheem in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 09-27-2009, 02:16 AM
  5. Replies: 0
    Last Post: 12-02-2008, 10:55 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •