How to configure logging in GlassFish for the WS-Policy implementation in WSIT II

In a previous blog entry, I described how to configure the logging level for the WSIT WS-Policy component in GlassFish v2 through the admin console. Thanks to Tom Amiro, I know now how to do the same by modifying the GlassFish configuration files. This may come in handy when you are just about to start the app server and don't want to wait until you can log into the admin console or when you are debugging an issue and need to have logging enabled right from the start.

  1. Locate the domain.xml file for your domain. The file is stored in $AS_HOME/domains/yourdomain/config/domain.xml.

  2. Locate the log-service element in domain.xml. It should look similarly to this:
    <log-service alarms="false" file="${com.sun.aas.instanceRoot}/logs/server.log"
    log-rotation-limit-in-bytes="2000000" log-rotation-timelimit-in-minutes="0"
    log-to-console="false" retain-error-statistics-for-hours="5" use-system-logging="false">
    <module-log-levels admin="INFO" classloader="INFO" cmp="INFO" cmp-container="INFO"
    configuration="INFO" connector="INFO" corba="INFO" deployment="INFO" ejb-container="INFO"
    group-management-service="INFO" javamail="INFO" jaxr="INFO" jaxrpc="INFO" jdo="INFO"
    jms="INFO" jta="INFO" jts="INFO" management-event="INFO" mdb-container="INFO" naming="INFO"
    node-agent="INFO" resource-adapter="INFO" root="INFO" saaj="INFO" security="INFO"
    self-management="INFO" server="INFO" synchronization="INFO" util="INFO" verifier="INFO"
    web-container="INFO"/>
    </log-service>
  3. Add the line <property name="javax.enterprise.resource.webservices.jaxws.wspolicy" value="FINE"/>. The value may of course be any logging level you want to set. The final result should look like this:
    <log-service alarms="false" file="${com.sun.aas.instanceRoot}/logs/server.log"
    log-rotation-limit-in-bytes="2000000" log-rotation-timelimit-in-minutes="0"
    log-to-console="false" retain-error-statistics-for-hours="5" use-system-logging="false">
    <module-log-levels admin="INFO" classloader="INFO" cmp="INFO" cmp-container="INFO"
    configuration="INFO" connector="INFO" corba="INFO" deployment="INFO" ejb-container="INFO"
    group-management-service="INFO" javamail="INFO" jaxr="INFO" jaxrpc="INFO" jdo="INFO"
    jms="INFO" jta="INFO" jts="INFO" management-event="INFO" mdb-container="INFO" naming="INFO"
    node-agent="INFO" resource-adapter="INFO" root="INFO" saaj="INFO" security="INFO"
    self-management="INFO" server="INFO" synchronization="INFO" util="INFO" verifier="INFO"
    web-container="INFO"/>
    <property name="javax.enterprise.resource.webservices.jaxws.wspolicy" value="FINE"/>
    </log-service>
Technorati:
Comments:

Post a Comment:
Comments are closed for this entry.
About

ritzmann

Search

Categories
Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today