• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

how to connect log4j to remote server

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am new to log4j and i have a problem. I have two app servers generating 2 seperate logging files. I need a way for them to generate a single logging file. A friend told me that we coudl do this by making log4j connect to a remote server to output.
I dont know how to do this or even if this possible or not. Please point me out in a correct direction.

thanks,
-Shashi
 
Rancher
Posts: 43045
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

log4j can log to a particular port on a remote machine, and the port can be monitored by the Chainsaw GUI application. I would guess that the TCP/IP connection is always on, though, so that 2 clients couldn't connect simultaneously, but that's just speculation - check the Chainsaw documentation.
 
Shashi Gere
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ulf.

Hmmm.. if two clients cant connect to it simultaneously then that wouldn't solve my basic problem right?? I mean i need a way for apps running to 2 servers to log into a common file.. and i thought the remote server was one way...
Is there any other way we can get over this dilemma ???
 
Sheriff
Posts: 27529
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would have thought that Chainsaw would accept multiple connections, but that's also just speculation. It's included in Log4j version 1.2.13 which I have here, and the documentation doesn't say one way or the other. However socket programs can support multiple simultaneous connections, so I wouldn't be surprised to find that Chainsaw does that. I would say, try it and see what happens.

I wrote a JMSAppender that uses a JMS queue for logging, but you would need a JMS implementation to make use of that.
 
Shashi Gere
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmmm... coming to think of it, i think thats the only way out Paul. But is the overhead high for setting up JMS ?? or is it simple and can be done with not much complexity?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic