NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Application Client rolling log file

 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
th2006
Posted via mailing list.





PostPosted: Wed Dec 03, 2008 7:21 pm    Post subject: Application Client rolling log file Reply with quote

I have an Glassfish application client that runs continuously and am
trying to configure logging to work manageably in this case. The file
'sun-acc.xml' contains a 'log-service' element with attributes only to
set the 'log-file' and 'level'. Is there a way to configure the
appclient log service to roll (since it is using the java.util.logging
package)?

Thanks - Tommy
Back to top
Wouter van Reeven
Posted via mailing list.





PostPosted: Wed Dec 03, 2008 7:31 pm    Post subject: Application Client rolling log file Reply with quote

On Wed, Dec 03, 2008 at 01:21:32PM -0600, address-removed wrote:
Quote:
I have an Glassfish application client that runs continuously and am
trying to configure logging to work manageably in this case. The file
'sun-acc.xml' contains a 'log-service' element with attributes only to
set the 'log-file' and 'level'. Is there a way to configure the
appclient log service to roll (since it is using the java.util.logging
package)?

Are you logging to the GlassFish server.log file or a separate one? The
server.log file is rolled when it reaches 2M and this can be configfured via the
admin interface.


HTH, Wouter van Reeven

--

People: "If she weighs the same as a Duck, she's made of wood!"
Sir Bedevere: "And therefore...?"
Back to top
th2006
Posted via mailing list.





PostPosted: Wed Dec 03, 2008 8:12 pm    Post subject: Application Client rolling log file Reply with quote

Hi Wouter,

No, at first I assumed it would log to the server but that is not how
the 'appclient' works... the Glassfish provided 'appclient' shell
script lauches its own JVM and does not transmit it's log data to the
app. server and thus, has nothing to do with the 'server.log' file.
By default, it logs to the console and the level is set to 'WARNING'.
I have configured it to write to a file 'client.log' with level
'INFO', but apparently that is all that can be done with the 'sun-
acc.xml' file.

- Tommy

On Dec 3, 2008, at 1:31 PM, Wouter van Reeven wrote:

Quote:
On Wed, Dec 03, 2008 at 01:21:32PM -0600, address-removed wrote:
Quote:
I have an Glassfish application client that runs continuously and am
trying to configure logging to work manageably in this case. The
file
'sun-acc.xml' contains a 'log-service' element with attributes only
to
set the 'log-file' and 'level'. Is there a way to configure the
appclient log service to roll (since it is using the
java.util.logging
package)?

Are you logging to the GlassFish server.log file or a separate one?
The
server.log file is rolled when it reaches 2M and this can be
configfured via the
admin interface.


HTH, Wouter van Reeven

--

People: "If she weighs the same as a Duck, she's made of wood!"
Sir Bedevere: "And therefore...?"
Back to top
Tim Quinn
Posted via mailing list.





PostPosted: Wed Dec 03, 2008 8:16 pm    Post subject: Application Client rolling log file Reply with quote

Hi, Tommy.

address-removed wrote:
Quote:
I have an Glassfish application client that runs continuously and am
trying to configure logging to work manageably in this case. The file
'sun-acc.xml' contains a 'log-service' element with attributes only to
set the 'log-file' and 'level'. Is there a way to configure the
appclient log service to roll (since it is using the java.util.logging
package)?
Unfortunately, not currently.

If you specify a file name in the <log-service> element of the
sun-acc.xml file, internally the app client container instantiates a
FileHandler object. But it does so using a constructor for FileHandler
that does not specify the count and limit values that would trigger the
rolling behavior, and such constructors cause the logging framework to
ignore the java.util.logging.FileHandler.count and .limit properties
(which you could otherwise set via the VMARGS environment variable
before invoking the appclient script). So the net effect is no rolling
behavior for the log.

To my knowledge we have not heard this request before for the app client
container. Please feel free to open a new issue tracker issue on the
standalone_client component of GlassFish
(https://glassfish.dev.java.net/issues/) to request this enhancement.
It seems like a reasonable thing to want to do.

- Tim
Back to top
th2006
Posted via mailing list.





PostPosted: Wed Dec 03, 2008 8:22 pm    Post subject: Application Client rolling log file Reply with quote

Hi Tim,

I will request the enhancement. In the mean time, would it work to
get the handler(s) from the logger object and set those attributes at
runtime for the file handler?

Thanks - Tommy

On Dec 3, 2008, at 2:16 PM, Tim Quinn wrote:

Quote:
Hi, Tommy.

address-removed wrote:
Quote:
I have an Glassfish application client that runs continuously and
am trying to configure logging to work manageably in this case.
The file 'sun-acc.xml' contains a 'log-service' element with
attributes only to set the 'log-file' and 'level'. Is there a way
to configure the appclient log service to roll (since it is using
the java.util.logging package)?
Unfortunately, not currently.

If you specify a file name in the <log-service> element of the sun-
acc.xml file, internally the app client container instantiates a
FileHandler object. But it does so using a constructor for
FileHandler that does not specify the count and limit values that
would trigger the rolling behavior, and such constructors cause the
logging framework to ignore the java.util.logging.FileHandler.count
and .limit properties (which you could otherwise set via the VMARGS
environment variable before invoking the appclient script). So the
net effect is no rolling behavior for the log.
To my knowledge we have not heard this request before for the app
client container. Please feel free to open a new issue tracker
issue on the standalone_client component of GlassFish (https://glassfish.dev.java.net/issues/
) to request this enhancement. It seems like a reasonable thing to
want to do.

- Tim
Back to top
Arshad Noor
Posted via mailing list.





PostPosted: Wed Dec 03, 2008 8:53 pm    Post subject: Application Client rolling log file Reply with quote

There shouldn't be a need for an RFE. The JVM used by the
client application manages its own logging using the
logging.properties file in the $JAVA_HOME/jre/lib directory.
By default, the JDK only uses the ConsoleHandler and logs
INFO. You can customize your client VM's logging in all the
ways defined at:

http://java.sun.com/javase/6/docs/technotes/guides/logging/index.html

Arshad Noor
StrongAuth, Inc.

address-removed wrote:
Quote:
Hi Tim,

I will request the enhancement. In the mean time, would it work to get
the handler(s) from the logger object and set those attributes at
runtime for the file handler?

Thanks - Tommy

On Dec 3, 2008, at 2:16 PM, Tim Quinn wrote:

Quote:
Hi, Tommy.

address-removed wrote:
Quote:
I have an Glassfish application client that runs continuously and am
trying to configure logging to work manageably in this case. The
file 'sun-acc.xml' contains a 'log-service' element with attributes
only to set the 'log-file' and 'level'. Is there a way to configure
the appclient log service to roll (since it is using the
java.util.logging package)?
Unfortunately, not currently.

If you specify a file name in the <log-service> element of the
sun-acc.xml file, internally the app client container instantiates a
FileHandler object. But it does so using a constructor for
FileHandler that does not specify the count and limit values that
would trigger the rolling behavior, and such constructors cause the
logging framework to ignore the java.util.logging.FileHandler.count
and .limit properties (which you could otherwise set via the VMARGS
environment variable before invoking the appclient script). So the
net effect is no rolling behavior for the log.
To my knowledge we have not heard this request before for the app
client container. Please feel free to open a new issue tracker issue
on the standalone_client component of GlassFish
(https://glassfish.dev.java.net/issues/) to request this enhancement.
It seems like a reasonable thing to want to do.

- Tim
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo