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