PackagePackagetypeA library you install and call yourself.See every one →What this type is →independently maintainedindependently maintainedoriginPublished by one person or a small company outside SAP. Says nothing about quality; the readings say that.See every one →

ABAP_LOGGING

An object-oriented wrapper around SAP's Business Application Log (BAL) for ABAP NetWeaver, chaining texts, messages and exceptions onto a log header that persists in its own or the same connection.

ZCL_CALOG_FACTORY=>CREATE_HEADER returns a log header, and ADD_TEXT, ADD_MESSAGE and ADD_EXCEPTION each return that header again, so the appends chain into one statement ending in PERSIST. PERSIST stores the log either in a parallel database connection, with no dependency on the surrounding transaction, or in the same one, and its IV_WITH_CALLSTACK parameter attaches the call stack to the BAL header, where transaction SLG1 shows it under Details. The maintainer gives the BAL API's verbosity and its lack of an object model as the reason for the wrapper. It installs through ZABAPGIT, the README's name for abapGit, and needs one post-installation step: a BAL log object and a subobject, both named ZCALOGDEF, created in transaction SLG0.

Facts

Last pushLicenceMIT

Where it sits

Lives in
Provides
LoggingABAPLoggingcapabilitySeeing what a running service did, in a form something can read afterwards — levels, a formatter that suits a laptop and one that suits a log service.
Requires
abapGitabapGitartifactInstalls the repository into the ABAP system via ZABAPGIT, the README's name for abapGit.

Who is behind it

franzreitmayerfranzreitmayerPersonMaintains this
In the atlas: maintains 1, contributes to 1
@franzreitmayer
maintainer

What it declares

Every artifact

Type
Package
Origin
Independently maintained

As a package

Where it runs
Inside its host
Distributed through
abapGit

Connections2

README

quoted from franzreitmayer/ABAP_LOGGING under MIT, read
franzreitmayer/ABAP_LOGGING/README.mdOn GitHub

ABAP_LOGGING

Simple Logging Framework for ABAP Netweaver

Description

This framework is designed to enable fluent, less verbose and isolated logging at ABAP Netweaver stack. ABAP Netweaver Stack offeres the Busines Application Log (BAL) to support logging. However the BAL-API is is still not object oriented and quite verbose. This framework offers an object oriented wrapper to support he most common logging operations.

Installation

The framework is managed on github with the use of ZABAPGIT (https://github.com/larshp/abapGit/blob/master/src/zabapgit.prog.abap) So you can use ZABAPGIT to install the code at your system. As a post installation task you need to create a BAL log object (Transaction SLG0) with the name ZCALOGDEF and a subobject assigned to with the same name ZCALOGDEF. In order to check wether the installation was successful you can run the unit test of class ZCL_CALOG_HEADER.

Usage

The report ZCALOG_SAMPLE report in package ZCALOG demonstrates how the framework can be used.

Use the central class ZCL_CALOG_FACTORY to get a header object to manager further logging:

" create a log header for default log object and sub object...
data(log_header) = ZCL_CALOG_FACTORY=>CREATE_HEADER( ).

Use the header object retrieved to write messages, texts and exceptions

" add a simle text message
log_header->ADD_TEXT( 'This is a test' ).

" add a message with parameters...
log_header->ADD_MESSAGE(
  exporting
    IV_MSGTY           = conv symsgty( 'E' )
    IV_MSGID           = CONV symsgid( 'ZCALOG_TST')
    IV_MSGNO           = CONV symsgno( 0 )
    IV_MSGV1           = 'Param 1'
    IV_MSGV2           = 'Param 2'
    IV_MSGV3           = 'Param 3'
    IV_MSGV4           = 'Param 4'
).

" add an exception
try.
  data(num) = 1 / 0.
catch cx_root into data(exception_ref).
  log_header->ADD_EXCEPTION( exception_ref ).
endtry.

Every method to append the log returns the logheader itself, thus you can chain the appends to keep coding short.

" use chained method calls to keep code short...
  ZCL_CALOG_FACTORY=>CREATE_HEADER(
  )->add_text( 'This is a test'
  )->ADD_MESSAGE( IV_MSGTY           = conv symsgty( 'E' )
    IV_MSGID           = CONV symsgid( 'ZCALOG_TST')
    IV_MSGNO           = CONV symsgno( 0 )
    IV_MSGV1           = 'Param 1'
    IV_MSGV2           = 'Param 2'
    IV_MSGV3           = 'Param 3'
    IV_MSGV4           = 'Param 4'
  )->ADD_EXCEPTION( EXCEPTION_REF )->PERSIST( ).

Call method persist to save the logs to database. the framework support two ways of storing the log (controlled by parameter iv_save_immediately). Please refer to the wikipages for further details:

  • Storing in a parallel db connection (no dependency to surrounding TX)
  • Storing in same db connection (depends on surrounding TX)

The method persist also has the paramter iv_with_callstack which allows to store the callstack at the BAL logheader. You can open the stacktrace (3) at transaction SLG1 by selecting the header (1) and click at the Details [F7] (2) as shown at the screenshot bellow. Screenshot stacktrace feature

MIT, read
Logging
  1. ABAP-LoggerLogging library for ABAP over the Application Log
  2. abap-log-exporterExports Business Application Log entries to Graylog or Loki
  3. ABAP-PRCFramework for multi-step ABAP processes with monitoring
  4. abap-logABAP logging library with one interface across output targets
  5. abap-cloud-loggerChainable logger for ABAP Cloud around CL_BALI_LOG
  6. abap-fm-loggerLogger storing RFC function module call parameters as JSON
  7. open-abap-balApplication logging for ABAP transpiled to JavaScript on Node.js
  8. abap-fluentdFluentd client in ABAP for sending log lines to a collector
  9. sap-usi-logging-apiObject-oriented wrapper around SAP's Application Log (SLG1)
  10. abap-message-loggerMessage logger for ABAP Cloud that saves to the Application Log

Details

Sources3
dotabapdiscovered herechecked
github.com/franzreitmayer/ABAP_LOGGINGtree, pushes, contributors, CIchecked
README.mdquoted, and what the entry declareschecked

Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.

Compatibility and provenance
discovered viadotabap
first seen in the atlas
ecosystem and domainabap, operations-and-runtime
abaplint
issues under its own abaplint configuration588
lines1,499
statements1,026
objects14
files25
analysed, master
abaplint version2.120.84
Flavors1
Standard ABAP
“Simple Logging Framework for ABAP Netweaver” — franzreitmayer/ABAP_LOGGING — READMEchecked
History in the atlas1
  1. First seen.
For your agent
Ref
artifact:franzreitmayer-abap-logging
JSON
/artifacts/franzreitmayer-abap-logging.json
MCP
Connecting an agent