Hi all,
At the moment I want to enable logging from an Applet to a file on the
server. If I have interpreted the documentation correctly, I should use the
SocketAppender. But my configuration resulted into an
AccessControlException:
log4j: Setting property [remoteHost] to ["123.45.67.89"].
log4j:ERROR Could not find address of ["123.45.67.89"].
java.security.AccessControlException: access denied
(java.net.SocketPermission "123.45.67.89" resolve)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at java.net.InetAddress.getByName(Unknown Source)
at
org.apache.log4j.net.SocketAppender.getAddressByName(SocketAppender.java:277)
at
org.apache.log4j.net.SocketAppender.setRemoteHost(SocketAppender.java:298)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.apache.log4j.config.PropertySetter.setProperty(PropertySetter.java:206)
at
org.apache.log4j.config.PropertySetter.setProperty(PropertySetter.java:165)
at
org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:130)
at
org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:97)
at
org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:689)
at
org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:647)
at
org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:544)
at
org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:440)
at
org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:476)
at
org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:471)
at org.apache.log4j.LogManager.<clinit>(LogManager.java:125)
at org.apache.log4j.Logger.getLogger(Logger.java:118)
at foo.bar.MyApplet.init(MyApplet.java:61)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
MyApplet is started from:
http://123.45.67.89/MyApplet/MyApplet.html
The log4j.properties file of the Applet contains:
log4j.debug=TRUE
log4j.rootLogger=INFO, R
log4j.appender.R=org.apache.log4j.net.SocketAppender
log4j.appender.R.RemoteHost="123.45.67.89"
log4j.appender.R.Port="6000"
log4j.logger.httpclient.wire.header=DEBUG
log4j.logger.org.apache.commons.httpclient=DEBUG
log4j.logger.org.apache.commons.httpclient.HttpClient=DEBUG
What is failing in my configuration?
TIA
Abel
PS:
Apache version: 2.2.6
Log4j version: 1.2.15
>From the AccessControlException JavaDoc:
This exception is thrown by the AccessController to indicate that a
requested access (to a critical system resource such as the file system or
the network) is denied.
"123.45.67.89" is the IP-address of my system
--
View this message in context:
http://www.nabble.com/Logging-events-in-Applet-to-server-using-log4j--tp15560516p15560516.html
Sent from the Log4j - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]