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: [EMAIL PROTECTED]
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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
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" <[EMAIL PROTECTED]>:

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:[EMAIL PROTECTED]
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:[EMAIL PROTECTED]
Sent: Monday, September 27, 2004 2:26 AM
To: [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
For additional commands, e-mail:

[EMAIL PROTECTED]


---
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to