This option use the logback_server.xml from the <ARSystemInstallDir>/conf directory to make logging changes.
In logback_server.xml, add the following under <configuration> tag.
(Note: the logback_server.xml is found in the conf directory on the AR Server)
<appender name="ARRESTWebservice"
class="com.bmc.arsys.logging.ReconfigurableRollingFileAppender">
<file>${com.bmc.arsys.homedir}/${com.bmc.arsys.server.dbdir}/arrestwebservice.log</file>
<append>true</append>
<param name="Encoding" value="UTF-8" />
<rollingPolicy class="com.bmc.arsys.logging.StoredRollingPolicy">
<fileNamePattern>${com.bmc.arsys.homedir}/${com.bmc.arsys.server.dbdir}/arrestwebservice.log.%i</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>8</maxIndex>
</rollingPolicy>
<triggeringPolicy class="com.bmc.arsys.logging.ARSizeBasedTriggeringPolicy">
<maxFileSize>128MB</maxFileSize>
</triggeringPolicy>
<!-- Extra param to say log file creation at startup -->
<needPreLoading>true</needPreLoading>
<encoder>
<pattern>%d{EEE MMM dd HH:mm:ss.SSS yyyy} [%thread] %-5level %logger{36} %m%nopex%n</pattern>
</encoder>
</appender>
Then also add:
<logger name="com.bmc.arsys.restapi.features" level="debug" additivity="false">
<appender-ref ref="ARRESTWebservice" />
</logger>
<logger name="com.bmc.arsys.restapi" level="debug" additivity="false">
<appender-ref ref="ARRESTWebservice" />
</logger>
<logger name="org.eclipse.jetty" level="debug" additivity="false">
<appender-ref ref="ARRESTWebservice" />
</logger>
Optionally, comment out the following as this information will now be on restapilog
<!--
<logger name="com.bmc.arsys.restapi.features" level="error"
additivity="false">
<appender-ref ref="ServerLog" />
<appender-ref ref="DebugLog" />
</logger>
<logger name="com.bmc.arsys.restapi" level="debug" additivity="false">
<appender-ref ref="Console" />
<appender-ref ref="StartupTraceLog" />
</logger> -->
See the attached logback_server.xml that includes a separate log for REST API and WEBSERVICES following the same pattern.
To confirm that the logging was enabled:
tail -f restapi.log | grep ".jetty."
For AR System 18.08 and newer.
Enable the jetty log level in the arserver.config file for Windows and in the arserverd.conf file for Linux.
Use the following JVM option:
-Dorg.eclipse.jetty.LEVEL=DEBUG
Enable extra Jetty Related logs in the Jetty/etc/Jetty.xml
Search for the following attribute "setDebugEnabled" and change its boolean value to "true":
<Call
class="org.eclipse.jetty.util.log.Log"
name="getRootLogger">
<Call
name="setDebugEnabled">
<Arg
type="boolean">true</Arg>
</Call>
Once you enable the logging, the jetty logs are displayed on the server console or in the armonitor.log file.
READING THE LOGS
On Windows, just look for SSL if it's enabled.
It will throw a lot of activity even just restarting.
-
To get Jetty startup logs, go to arerror.log.Below are some patterns found that can be used as references.
-
Port opened : Thu Aug 04 07:42:29.610 2016 Container org.eclipse.jetty.server.Server@75c56eb9 + SslSelectChannelConnector@0.0.0.0:10443 as connector
-
Keystore not found: Thu Aug 04 07:09:11.205 2016 FAILED SslContextFactory@52815fa3(./jetty./etc/keystore,./jetty./etc/keystore): java.io.FileNotFoundException: C:\Program Files\BMC Software\ARSystem\jetty\etc\keystore (The system cannot find the file specified)
-
Port not being opened: Thu Aug 04 07:09:12.205 2016 STOPPED SslSelectChannelConnector@0.0.0.0:10443
-
To get jetty low-level activity from REST API, go to arerror.log
-
New incoming connection : Thu Aug 04 07:27:14.999 2016 created SCEP@52bd234d{l(/172.18.142.70:57748)<->r(/172.22.233.120:10443),s=0,open=true,ishut=false,oshut=false,rb=false,wb=false,w=true,i=0}-{SslConnection@c1ac5b7 SSL NOT_HANDSHAKING i/o/u=-1/-1/-1 ishut=false oshut=false {AsyncHttpConnection@71029044,g=HttpGenerator{s=0,h=-1,b=-1,c=-1},p=HttpParser{s=-14,l=0,c=0},r=0}}
-
Trace your session with Session-Number
-
Thu Aug 04 07:27:14.999 2016 [Session-1, SSL_NULL_WITH_NULL_NULL] SslConnection…
-
Thu Aug 04 07:27:14.999 2016 [Session-1, SSL_NULL_WITH_NULL_NULL] handle SslCon…
-
Thu Aug 04 07:27:14.999 2016 [Session-1, SSL_NULL_WITH_NULL_NULL] SslConnection…
-
Thu Aug 04 07:27:14.999 2016 [Session-1, SSL_NULL_WITH_NULL_NULL] unwrap OK NEE…
-
Session ended:
-
Thu Aug 04 07:27:14.999 2016 [Session-1, SSL_NULL_WITH_NULL_NULL] handle SslConnection@c1ac5b7 SSL NEED_UNWRAP i/o/u=0/0/0 ishut=false oshut=false {AsyncHttpConnection@71029044,g=HttpGenerator{s=0,h=-1,b=-1,c=-1},p=HttpParser{s=-14,l=0,c=0},r=0} progress=false
-
To see the actual API calls, enable API logs
-
<API > ...*/ +GS ARGetSchema -- schema User from Unidentified Client (protocol 19) at IP address {IP_Address} using REST // :q:0.0s
-
<API >...*/ +GLEWF ARGetListEntryWithFields -- schema User from Unidentified Client (protocol 19) at IP address {IP_Address} 0 using REST // :q:0.0s
-
<API >...*/ +GS ARGetSchema -- schema User from Unidentified Client (protocol 19) at IP address {IP_Address} using REST // :q:0.0s
-
<API >...*/ +GLEWF ARGetListEntryWithFields -- schema User from Unidentified Client (protocol 19) at IP address {IP_Address} using REST // :q:0.0s
-
<API >...*/ +GS ARGetSchema -- schema TMS:Task from Unidentified Client (protocol 19) at IP address {IP_Address} using REST // :q:0.0s