logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francesco Russo <f.ru...@cineca.it>
Subject Re: How to use log4j in applet?
Date Wed, 29 Sep 2004 09:38:03 GMT
Hi Baris,
the socket appender must not have a file attribute.
Instead you are required to run on the remote log server something like 
that:

java org.apache.log4j.net.SimpleSocketServer port# serverSocketLog4j.xml

Tha last argument is a log4j config file containing the definition of a 
logger called exactly as the one using a socket appender, but associated 
with a file appender i.e.

So all the logging requests originated at the client will be firstly 
sent to the "x" logger which uses a socket appender; this logger will 
forward the logging request to the SimpleSocketServer that will use the 
locally defined "x" logger to output the message using its own appender 
(i.e. a file appender).
In order to make this all work you have to start your logging 
application with the followin properties set:
-Dhost=... -Dport=...
where host and port are the host and port where the SimpleSocketServer 
is listening.

Hope this helps,

-- 
______________________________________________________
Francesco Russo
CINECA - Interuniversitary Computing Centre
http://www.cineca.it
via Magnanelli, 6/3
40033 Casalecchio di Reno (Bologna) - ITALY
e-mail: f.russo@cineca.it
Phone: +39 051 6171 775


Baris Yalcin wrote:
> Am Dienstag, 28. September 2004 14:41 schrieb Shapira, Yoav:
> 
> I am sorry, but I don't understand how to use the SocketAppender for an 
> applet. The SocketAppender hasn't a file attribute, only the attributes port 
> and remote-host. So how can I write to a file with the SocketAppender?
> What's about the FileAppender, isn't there any possibility?
> 
> Baris
> 
> 
>>Hi,
>>Yes.  See the SocketAppender JavaDoc.
>>
>>Yoav Shapira
>>Millennium Research Informatics
>>
>>
>>>-----Original Message-----
>>>From: B.Yalcin@dkfz-heidelberg.de [mailto:B.Yalcin@dkfz-heidelberg.de]
>>>Sent: Monday, September 27, 2004 4:25 PM
>>>To: Log4J Users List; Shapira, Yoav
>>>Subject: RE: How to use log4j in applet?
>>>
>>>Zitiere "Shapira, Yoav" <Yoav.Shapira@mpi.com>:
>>>
>>>Hi Yoav,
>>>
>>>thank you for your answer.
>>>
>>>I want to log error messages from an applet into a log-file on the
>>
>>server,
>>
>>
>>>not
>>>at the client. If somebody uses the applet and an error occurs, I can
>>
>>check
>>
>>
>>>the
>>>detailed error in the log-file at the server.
>>>
>>>Do You have an idea how to realize logging with log4j in an applet?
>>>
>>>Baris
>>>
>>>
>>>>Hi,
>>>>You could use log4j for a lot more than writing files.  For example
>>
>>to
>>
>>
>>>>send emails, send JMS messages, or in fact in messages to a
>>>>SocketAppender.  Any of these can be valid use-cases.  Obviously, one
>>>>also CAN write to files on the user's system with the appropriate
>>
>>Applet
>>
>>
>>>>certificates and security policy (which are frequently provided in
>>>>intranet settings).
>>>>
>>>>Yoav Shapira
>>>>Millennium Research Informatics
>>>>
>>>>
>>>>>-----Original Message-----
>>>>>From: Ivan Jouikov [mailto:ivan@ablogic.net]
>>>>>Sent: Monday, September 27, 2004 1:34 PM
>>>>>To: 'Log4J Users List'
>>>>>Subject: RE: How to use log4j in applet?
>>>>>
>>>>>Why would you want to use log4j in an applet?  You aren't allowed to
>>>>
>>>>write
>>>>
>>>>
>>>>>into files on the user's system.  If you need to do debugging -
>>
>>what's
>>
>>
>>>>>wrong with System.out?
>>>>>
>>>>>
>>>>>>-----Original Message-----
>>>>>>From: Baris Yalcin [mailto:B.Yalcin@dkfz-heidelberg.de]
>>>>>>Sent: Monday, September 27, 2004 2:26 AM
>>>>>>To: log4j-user@logging.apache.org
>>>>>>Subject: How to use log4j in applet?
>>>>>>
>>>>>>Hi everyone,
>>>>>>
>>>>>>I would like to use log4j in an applet. Unfortunately I couldn't
>>
>>find
>>
>>
>>>>any
>>>>
>>>>
>>>>>>example.
>>>>>>
>>>>>>Is there any documentation which shows how to configure log4j with
>>>>>>applets?
>>>>>>
>>>>>>Or does somebody have an example for me (applet and log4j.xml) how
>>
>>to
>>
>>
>>>>>>realize
>>>>>>logging with log4j in an applet?
>>>>>>
>>>>>>Thanks a lot in advance,
>>>>>>
>>>>>>Baris
>>
>>---------------------------------------------------------------------
>>
>>
>>>>>>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>>>>>>For additional commands, e-mail:
>>
>>log4j-user-help@logging.apache.org
>>
>>
>>>>>>---
>>>>>>Incoming mail is certified Virus Free.
>>>>>>Checked by AVG anti-virus system (http://www.grisoft.com).
>>>>>>Version: 6.0.766 / Virus Database: 513 - Release Date: 17.09.2004
>>>>>
>>>>>---
>>>>>Outgoing mail is certified Virus Free.
>>>>>Checked by AVG anti-virus system (http://www.grisoft.com).
>>>>>Version: 6.0.766 / Virus Database: 513 - Release Date: 17.09.2004
>>>
>>>---------------------------------------------------------------------
>>>
>>>
>>>>>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>>>>>For additional commands, e-mail: log4j-user-help@logging.apache.org
>>>>
>>>>This e-mail, including any attachments, is a confidential business
>>>>communication, and may contain information that is confidential,
>>>>proprietary and/or privileged.  This e-mail is intended only for the
>>>>individual(s) to whom it is addressed, and may not be saved, copied,
>>>>printed, disclosed or used by anyone else.  If you are not the(an)
>>>>intended recipient, please immediately delete this e-mail from your
>>>>computer system and notify the sender.  Thank you.
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>>>>For additional commands, e-mail: log4j-user-help@logging.apache.org
>>
>>This e-mail, including any attachments, is a confidential business
>>communication, and may contain information that is confidential,
>>proprietary and/or privileged.  This e-mail is intended only for the
>>individual(s) to whom it is addressed, and may not be saved, copied,
>>printed, disclosed or used by anyone else.  If you are not the(an) intended
>>recipient, please immediately delete this e-mail from your computer system
>>and notify the sender.  Thank you.
>>
>>
>>---------------------------------------------------------------------
>>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


Mime
View raw message