You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Abhinav Rana <ab...@oracle.com> on 2017/12/11 08:13:37 UTC

Remote Logging

Hello,

So i have this task to log activities to a file, but it has to be done 
remotely on the server side, Remote logging.
I found out that before log4j 2.6 to listen to a port we used 
TcpSocketServer which started a server using LogEventBridge
         * This class was in core.net.server which is no longer available
         * Assuming it is not used anymore and the only similar/closest 
class, TcpSocketManager

My task was simple
1. Send logging info to a port.
2. Log info from port to a file.

Socket appender configuration

appender.socket.type = Socket
appender.socket.name= Socket_Appender
appender.socket.host = "IP address"
appender.socket.port = 8101
appender.socket.layout.type = SerializedLayout
appender.socket.connectTimeoutMillis = 2000
appender.socket.reconnectionDelayMillis = 1000
appender.socket.protocol = TCP

Then i tried this

/*public static final Logger LOG = 
LogManager.getLogger(myapp.class.getName());*/
and got the following error
/**//*main ERROR TcpSocketManager (TCP:IPAddress:8111) caught exception 
and will continue: java.net.SocketTimeoutException: connect timed out
*/
I need help how to go ahead.

Thank You
Abhinav Rana







Re: Remote Logging

Posted by Remko Popma <re...@gmail.com>.
You can also check out and build that module yourself. The repository is here: https://github.com/apache/logging-log4j-tools

 It is ready for release, there are no outstanding tickets on that module. 

(Shameless plug) Every java main() method deserves http://picocli.info

> On Dec 12, 2017, at 13:22, Abhinav Rana <ab...@oracle.com> wrote:
> 
> Hi,
> 
> So for the latest version of Log4j2(2.10) is there no way to do remote logging  ?
> I need to wait for the release ?
> 
> Thank You
> Abhinav Rana
> 
> 
>> On 12/11/2017 3:53 PM, Apache wrote:
>> The server is now in a separate git project. While it is usable it was really meant to be a sample that users could use to start from to build their own server. We will be publishing a release soon.
>> 
>> Ralph
>> 
>>> On Dec 11, 2017, at 1:13 AM, Abhinav Rana <ab...@oracle.com> wrote:
>>> 
>>> Hello,
>>> 
>>> So i have this task to log activities to a file, but it has to be done remotely on the server side, Remote logging.
>>> I found out that before log4j 2.6 to listen to a port we used TcpSocketServer which started a server using LogEventBridge
>>>         * This class was in core.net.server which is no longer available
>>>         * Assuming it is not used anymore and the only similar/closest class, TcpSocketManager
>>> 
>>> My task was simple
>>> 1. Send logging info to a port.
>>> 2. Log info from port to a file.
>>> 
>>> Socket appender configuration
>>> 
>>> appender.socket.type = Socket
>>> appender.socket.name= Socket_Appender
>>> appender.socket.host = "IP address"
>>> appender.socket.port = 8101
>>> appender.socket.layout.type = SerializedLayout
>>> appender.socket.connectTimeoutMillis = 2000
>>> appender.socket.reconnectionDelayMillis = 1000
>>> appender.socket.protocol = TCP
>>> 
>>> Then i tried this
>>> 
>>> /*public static final Logger LOG = LogManager.getLogger(myapp.class.getName());*/
>>> and got the following error
>>> /**//*main ERROR TcpSocketManager (TCP:IPAddress:8111) caught exception and will continue: java.net.SocketTimeoutException: connect timed out
>>> */
>>> I need help how to go ahead.
>>> 
>>> Thank You
>>> Abhinav Rana
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 

Re: Remote Logging

Posted by Abhinav Rana <ab...@oracle.com>.
Hi,

So for the latest version of Log4j2(2.10) is there no way to do remote 
logging  ?
I need to wait for the release ?

Thank You
Abhinav Rana


On 12/11/2017 3:53 PM, Apache wrote:
> The server is now in a separate git project. While it is usable it was really meant to be a sample that users could use to start from to build their own server. We will be publishing a release soon.
>
> Ralph
>
>> On Dec 11, 2017, at 1:13 AM, Abhinav Rana <ab...@oracle.com> wrote:
>>
>> Hello,
>>
>> So i have this task to log activities to a file, but it has to be done remotely on the server side, Remote logging.
>> I found out that before log4j 2.6 to listen to a port we used TcpSocketServer which started a server using LogEventBridge
>>          * This class was in core.net.server which is no longer available
>>          * Assuming it is not used anymore and the only similar/closest class, TcpSocketManager
>>
>> My task was simple
>> 1. Send logging info to a port.
>> 2. Log info from port to a file.
>>
>> Socket appender configuration
>>
>> appender.socket.type = Socket
>> appender.socket.name= Socket_Appender
>> appender.socket.host = "IP address"
>> appender.socket.port = 8101
>> appender.socket.layout.type = SerializedLayout
>> appender.socket.connectTimeoutMillis = 2000
>> appender.socket.reconnectionDelayMillis = 1000
>> appender.socket.protocol = TCP
>>
>> Then i tried this
>>
>> /*public static final Logger LOG = LogManager.getLogger(myapp.class.getName());*/
>> and got the following error
>> /**//*main ERROR TcpSocketManager (TCP:IPAddress:8111) caught exception and will continue: java.net.SocketTimeoutException: connect timed out
>> */
>> I need help how to go ahead.
>>
>> Thank You
>> Abhinav Rana
>>
>>
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Remote Logging

Posted by Apache <ra...@dslextreme.com>.
The server is now in a separate git project. While it is usable it was really meant to be a sample that users could use to start from to build their own server. We will be publishing a release soon.

Ralph

> On Dec 11, 2017, at 1:13 AM, Abhinav Rana <ab...@oracle.com> wrote:
> 
> Hello,
> 
> So i have this task to log activities to a file, but it has to be done remotely on the server side, Remote logging.
> I found out that before log4j 2.6 to listen to a port we used TcpSocketServer which started a server using LogEventBridge
>         * This class was in core.net.server which is no longer available
>         * Assuming it is not used anymore and the only similar/closest class, TcpSocketManager
> 
> My task was simple
> 1. Send logging info to a port.
> 2. Log info from port to a file.
> 
> Socket appender configuration
> 
> appender.socket.type = Socket
> appender.socket.name= Socket_Appender
> appender.socket.host = "IP address"
> appender.socket.port = 8101
> appender.socket.layout.type = SerializedLayout
> appender.socket.connectTimeoutMillis = 2000
> appender.socket.reconnectionDelayMillis = 1000
> appender.socket.protocol = TCP
> 
> Then i tried this
> 
> /*public static final Logger LOG = LogManager.getLogger(myapp.class.getName());*/
> and got the following error
> /**//*main ERROR TcpSocketManager (TCP:IPAddress:8111) caught exception and will continue: java.net.SocketTimeoutException: connect timed out
> */
> I need help how to go ahead.
> 
> Thank You
> Abhinav Rana
> 
> 
> 
> 
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org