Depending on the situation you’re analyzing, you may enable different loggers. Here are some recommendations we have found valuable over the past years doing support for OSLC Connect for Jira.
Prepare your logs with some specific notes
When doing debug sessions, it’s always valuable to easily identify what actions were undertaken when a specific log message appears. The start of the session deserves a specific notice, as would any action that one would perform, e.g. the last click before a given problem appears or the modification of a specific configuration key. This will help review the logs immediately after the session, but also will help with retaining a certain level of understanding weeks on months later.
Since Siemens does not offer the same level of features as does Atlassian in their Jira product, we have to resort to using administrator tricks here! Our suggestion for this is to:
identify which files you wish to supervise
log into these files with the following script
Linux
#!/bin/sh
for i in "${@:2}"
do
echo -ne "\n\n\n**** ${1}\n\n" >> ${i} # mark the nth log file
done
exit
Create the marklogs.sh file inside the logs folder (typically <Polarion installation dir>/data/logs then make it executable (using chmod u+x marklogs.sh). You can then mark any log file by specifying the comment as the first argument, and every log file you want to impact as subsequent arguments:
./marklogs.sh "Starting the OSLC debug session" ldx.log ldx-internalSso.log
Create the marklogs.ps1 file inside the logs folder (typically <Polarion installation dir>/data/logs. You can then mark any log file by specifying the comment as the first argument, and every log file you want to impact as subsequent arguments:
./marklogs.ps1 "Starting the OSLC debug session" main/log4j-20211018-1137-19.log main/log4j-oslc-20211028-1235-14.log
Windows (Batch)
@echo off
setlocal enabledelayedexpansion
set argCount=0
for %%x in (%*) do (
set /A argCount+=1
set "argVec[!argCount!]=%%~x"
)
for /L %%i in (2,1,%argCount%) do (
(echo:& echo:& echo:& (echo *** %~1)& echo:& echo:)>>"!argVec[%%i]!"
)
Create the marklogs.bat file inside the logs folder (typically <Polarion installation dir>/data/logs. You can then mark any log file by specifying the comment as the first argument, and every log file you want to impact as subsequent arguments:
./marklogs.bat "Starting the OSLC debug session" main/log4j-20211018-1137-19.log main/log4j-oslc-20211028-1235-14.log
The result will look like this:
2021-10-27 18:37:54,336 [Monitoring] INFO com.polarion.platform.monitoring - Executing action 'system.info.memory.oldGen.free'
2021-10-27 18:37:54,336 [Monitoring] INFO com.polarion.platform.monitoring - system.info.memory.oldGen.free (Free Old Gen memory after GC) = Java Heap Memory
Old Gen pool has 88.51% memory free after GC.
[Wed Oct 27 18:37:54 CEST 2021]
2021-10-27 18:37:54,505 [Monitoring] INFO com.polarion.platform.monitoring - Finished with actions from stage PERIODIC: {OK=6}
*** Starting the OSLC debug session
<new logs will appear here>
Decide on what to review
Review incoming requests to Polarion
Incoming requests are listed in the access log. Polarion comes bundled with a tool that dispatches all incoming requests to the Polarion app. That tool is called the Apache HTTP Server. This is the tool which provides the log for incoming requests, called the access log.
Logs for this are either available at <Polarion installation dir>/data/logs/apache or /var/log/httpd, depending on the underlying operating system. You should have some access.log.<year>-<week_number> file or a access_log file.
For an advanced access log format, you can expand this section.
The LogFormat directive can be highly customized to include as much data as possible.
This has been tested successfully on Linux deployments.
This directive can be updated in the httpd.conf file, in the <IfModule log_config_module> block.
Copy the lines you want to investigate to the 2nd+ line of the Excel Sheet
if the copied header or lines are not automatically expanded to columns
Select column Accept
In the "Data" banner, click the button called "Text to Column"
Choose "delimited", then Next
Review outgoing requests sent by Polarion, and Polarion processing
Polarion logs are located at <Polarion installation dir>/data/logs/
As suggested here in the “Polarion log4j log files” section, you can override the default log4j configuration by copying it to the right place.
Once done, one can enable additional logging to help debug potential problems by adding the following block at the end of the newly copied log4j.properties:
# APPENDER OSLCSODIUS
# ==================
log4j.appender.OSLCSODIUS=org.apache.log4j.DailyRollingDotMetadataFileAppender
log4j.appender.OSLCSODIUS.threshold=DEBUG
log4j.appender.OSLCSODIUS.file=log4j-oslc-sodius.log
log4j.appender.OSLCSODIUS.append=false
log4j.appender.OSLCSODIUS.layout=org.apache.log4j.PatternLayout
log4j.appender.OSLCSODIUS.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n
log4j.appender.OSLCSODIUS.datePattern='.'yyyy-ww
# Outgoing requests
log4j.logger.org.apache.http=DEBUG, OSLCSODIUS
# OSLC processing: anything that is Lyo related
log4j.logger.org.eclipse.lyo=DEBUG, OSLCSODIUS
# OSLC processing: plugin providing most of the OSLC
log4j.logger.com.polarion.alm.oslc=DEBUG, OSLCSODIUS
You can add everything or just keep the sections that matter to you, depending on whether you wish to investigate OSLC processing issues or outgoing requests issues.
Finishing the debug session
Restore your system’s previous logging features
In the log4j.properties file, update the threshold to OFF:
log4j.appender.OSLCSODIUS.threshold=OFF
Then you may OFF all the related loggers:
# Outgoing requests
log4j.logger.org.apache.http=OFF, OSLCSODIUS
# OSLC processing: anything that is Lyo related
log4j.logger.org.eclipse.lyo=OFF, OSLCSODIUS
# OSLC processing: plugin providing most of the OSLC
log4j.logger.com.polarion.alm.oslc=OFF, OSLCSODIUS
Retrieving Polarion logs
Open the following most recent log files with this below pattern to see the log entries:
We suggest attaching the log file(s) to a Jira ticket on our customer support portal if you think these provide insight into the problem you have identified, or if they were requested.