Skip to main content

Development Environment

After cloning the tutorial repository, you'll find a few files:


pluginManagement {
repositories {

We need the gradle plugin portal in order to get the jPOS APP Gradle Plugin.


plugins {
id 'org.jpos.jposapp' version '0.0.6'
id 'java-library'

group = 'org.jpos.jposapp'
version = '0.0.1-SNAPSHOT'

repositories {
maven { url = uri('') }

dependencies {
implementation 'org.jpos:jpos:3.0.0-SNAPSHOT'

Here we define a couple plugins:

  • The jposapp plugin that provides the dist, installApp, and other jPOS related tasks.
  • The java-library plugin used to build a Java code.

Then we define a group and version name for this application, and we configure jPOS as a dependency.


<logger name="Q2">
<property name="redirect" value="stdout, stderr" />
<log-listener class="org.jpos.util.SimpleLogListener" />

<log-listener class="org.jpos.util.RotateLogListener">
<property name="file" value="log/q2.log" />
<property name="window" value="86400" />
<property name="copies" value="90" />
<property name="maxsize" value="100000000" />

Later in the tutorial, we'll delve deeply into logger configuration. For now, we present an example configuration to illustrate what it entails.

In this setup, a logger named Q2 is defined, accompanied by specific configurations. One such configuration is the 'redirect' property, which directs both stdout and stderr to the logger. Additionally, there are a couple of listeners configured: the SimpleLogListener directs log output to stdout, while the second listener maintains a log history, retaining up to 90 days of logs with each file capped at 100MB.


<sysmon logger="Q2">
<attr name="sleepTime" type="java.lang.Long">3600000</attr>
<attr name="detailRequired" type="java.lang.Boolean">true</attr>

If you started Q2 in the previous exercise, you might have noticed a log entry like this:

<log realm="org.jpos.q2.qbean.SystemMonitor" at="2023-11-13T12:57:11.005240">
OS: Mac OS X (13.5.1)
Java: 21.0.1 (Oracle Corporation) AES-secure
environment: default
process name: 65998@apr-2.local
user name: jpos
host: jpos.local/
cwd: /opt/local/jpos/tutorial
free space: 396.7 GiB
version: 3.0.0-SNAPSHOT (9565627)
instance: cb6e2224-da4c-47c0-9897-fd6be13fb03f
uptime: 00:00:00.652 (2.780762)
processors: 16
drift : 0
memory(t/u/f): 258/31/226
encoding: UTF-8
timezone: America/Montevideo (Uruguay Time) -03:00
watch service: sun.nio.fs.PollingWatchService
metrics dir: log
clock: 1699891031 2023-11-13T15:57:10.911673Z
thread count: 11
peak threads: 11
user threads: 6
Thread[#9,Reference Handler,10,system]
Thread[#11,Signal Dispatcher,9,system]
Thread[#26,Notification Thread,9,system]
Q2: org.jpos.q2.Q2
logger.Q2: org.jpos.util.Logger

While the specific content currently discussed may not be pertinent yet, it serves as an illustrative example of how a jPOS QBean can be utilized for self-monitoring purposes.