Buscar este blog

martes, 14 de abril de 2020

CentOS check system info

Show system inf for a CentOS server:
# CPU info
 more /proc/cpuinfo

# Memory info
 dmidecode -t memory
 dmidecode -t memory | grep -i "installed size"

# Operatin System
 cat /etc/os-release
 hostnamectl
 uname -r

viernes, 10 de abril de 2020

Axis 1 - SLF4J Logging

In this post I´ll show you how to configure Axis 1 Logging with SLF4J-Log4j. The main purpose is to trace incoming and outcoming messages.

Axis uses Apache commons-logging as logging implementation. This dependecy is configured as runtime in Axis pom, so it will not be imported as transitive.
Any way, if you have commons-logging library in your project, exclude it.

As you exclude commons-logging, you need to add the corresponding slf4j bridge, i.e., jcl-over-slf4j library.

Add a file called common-logging.properties in src/main/resoruces with the following content:
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.SLF4JLogFactory

When you configure log4j logging, for example in log4j.xml file,  add the following categories:
<logger name="org.apache.axis.providers" additivity="false">
 <level value="debug"/>
 <appender-ref ref="FILE"/>
</logger>

<logger name="org.apache.axis.transport.http" additivity="false">
 <level value="debug"/>
 <appender-ref ref="FILE"/>
</logger>

org.apache.axis.providers is used by web service providers in order to trace incoming messages and outcoming responses.

org.apache.axis.transport.http is used by web service clientes in order to trace outcoming messages and incoming responses.