Java extension: write log messages

outsystems (author: Marcel Lambrechts)

inSystems Error

When you are developing extensions for OutSystems using the integration studio, you might want to get some debug messages. For extensions written in Java, a simple System.out.println won’t work, but you can write (debug) messages to the “General” log of your OutSystems platform.

You can read this log by using ServiceCenter or selecting directly from the database table (OSLOG_GENERAL), if you have the proper database privileges of course.

To write messages to OutSystems “General” log, you can use the following (static) methods:

  • GenericExtendedActioins.audit
  • GeneralLog.staticWrite

The “audit” method is the simplest of them, while it only requires 3 arguments to be specified:

  1. The OutSystems application context
  2. The message you want to write to the log (maximum of 2000 characters)
  3. A “module” name that you can use to filter on in ServiceCenter (maximum of 15 characters)

A simple example of using the static “audit” method, that will write the message “Write my message” to the general log table, using “MyModule” as the module name, is:

GenericExtendedActions.audit(AppInfo.getAppInfo().getOsContext(), “Write my message”, “MyModule”);

The “staticWrite” method of the GeneralLog class requires more arguments to be specified, but gives you more control over the various fields stored in the log table. You can, as an example, specify a specific timestamp.

The parameters that are defined by the “staticWrite” method are:

  1. Timestamp
  2. Session ID (String value)
  3. eSpace ID
  4. Tenant ID
  5. User ID
  6. Message you want to write to the log (maximum length 2000 characters)
  7. Message type (normally USER, INFO, WARNING – maximum length 10 characters)
  8. A “module” name that you can use to filter on in ServiceCenter (maximum of 15 characters)
  9. Error Identifier. A String value you can specify to add extra information. You won’t however see the content of this field, when using ServiceCenter (maximum of 50 characters)

Here’s an example of using the GeneralLog.staticWrite method, writing the message “Message to write” to the general log table, using “MyModule” as the module name that you might use to filter on in ServiceCenter:

GeneralLog.staticWrite(DateTime.getNow(), AppInfo.getAppInfo().getOsContext().getSession().getSessionID(), AppInfo.getAppInfo().geteSpaceId() , AppInfo.getAppInfo().getTenant().getId(), AppInfo.getAppInfo().getOsContext().getSession().getUserId(), “Message to write”, “USER”, “MyModule”, ” “);

Besides these methods you can use to write to OutSystems “General” log, there’s also an option to write to OutSystems “Error” log (database table OSLOG_ERROR). For this you should use the ErrorLog class, that contains various methods for this purpose.

Here’s an example to write a message to the “Error” log:

ErrorLog.staticWrite(DateTime.getNow(), AppInfo.getAppInfo().getOsContext().getSession().getSessionID(), AppInfo.getAppInfo().geteSpaceId() , AppInfo.getAppInfo().getTenant().getId(), AppInfo.getAppInfo().getOsContext().getSession().getUserId(), “Message to write”, “Error stack”, “Env. info”, “MyModule”);

Share this

Contact

Heb je vragen of opmerkingen? Aarzel niet om contact op te nemen. Dat kan via de algemene contactgegevens, rechtstreeks met de genoemde contactpersoon op een van de detailpagina’s, of via onderstaande knop.

29 juni 2026

Welke midlance regeling past bij mij?

Medium-lance / Midlance wint snel aan populariteit. Het combineert de zekerheid van een vast dienstverband met de mogelijkheid om een aanzienlijk hoger inkomen te verdienen wanneer je op mooie opdrachten wordt ingezet.

18 juni 2026

AI inspiratiesessie

AI is nauwelijks nog weg te denken uit het nieuws. Vrijwel dagelijks verschijnen er berichten over nieuwe AI-toepassingen. Dat roept vragen op. Wat is AI eigenlijk precies? Wat kunnen deze systemen wel en niet? Wat betekent dit voor mij?

Opdrachten uitgevoerd voor

Oracle University
MN Services
Nederlandse Spoorwegen
Van Iperen Groeispecialisten
Gemeente Gouda
RIGD LOXIA
Feenstra inSystems
Rijk Zwaan inSystems
RAVU
Fokker
Rendo
Belastingdienst
Gemeente Apeldoorn
Provincie Utrecht
Multi Tank Card
JUVA
CBR
Thales
Twinq
SVB
Gemeente Den Haag
Bank Mendes Gans
Syntrus Achmea Real Estate & Finance
Telegraaf Media Groep
Ministerie van Economische Zaken, Landbouw & Innovatie
Stedin
Arval BNP Paribas
Stratech Social
Greenchoice
Politie
PC Uitvaart
Cannock
inSystems KLM
AgroEnergy
TenneT
Allianz
NVWA inSystems
BMW
Holland Casino
ASR Nederland
Alliance Healthcare
VTTI
Ziggo
Rechtspraak
GVB
Alphabet
IBM
inSystems Unive
CB Logistics
Universiteit Tilburg
VAA ICT Consultancy
Ahold
UBR Uitvoeringsorganisatie Bedrijfsvoering Rijk
WVDB Adviseurs Accountants
TU Eindhoven
Darling
Altran
Eneco
Leaseplan
ING Bank
Rabobank
VION Food Group
DICTU