# Logging for Natural

**URL:** <https://techcommunity.softwareag.com/t/logging-for-natural/61613>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-Utilities\
**Created:** [October 24, 2006, 10:02pm UTC](https://techcommunity.softwareag.com/t/logging-for-natural/61613 "2006-10-24T22:02:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Curtis\_Pew](https://avatars.discourse-cdn.com/v4/letter/c/5f9b8f/32.png) [@Curtis\_Pew](https://techcommunity.softwareag.com/u/Curtis_Pew)\
**Post date:** [October 24, 2006, 10:02pm UTC](https://techcommunity.softwareag.com/t/logging-for-natural/61613/1 "2006-10-24T22:02:59Z")

</div>

Some of our developers here have been asking if anyone has developed a logging facility for Natural. (These programmers also work in Java; they’re thinking of something like log4j.) One suggestion was to use SYSRDC, but that looks at more of a systems level; we’d want to trace application-defined events with variable control over the level of logging. Has anyone done anything like this?

---

<div class="post-metadata">

**Author:** ![Mark\_Barnard](https://avatars.discourse-cdn.com/v4/letter/m/bc8723/32.png) [@Mark\_Barnard](https://techcommunity.softwareag.com/u/Mark_Barnard)\
**Post date:** [October 25, 2006, 12:50am UTC](https://techcommunity.softwareag.com/t/logging-for-natural/61613/2 "2006-10-25T00:50:49Z")

</div>

If you have Construct or Natural Business Services you can use the Trace and Debug Utilities to perform something similar to log4j. The utilities even automatically add tracing statements to exiting natural code if you want. You can also control when and where the output is written (screen, source area, work files, print files, etc…).

For more information, see the section “Supplied Generation Utilities” in the Generation Users Guide of the official documentation.

---

<div class="post-metadata">

**Author:** ![Wilfried\_B](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/wilfried_b/32/83_2.png) [@Wilfried\_B](https://techcommunity.softwareag.com/u/Wilfried_B)\
**Post date:** [October 25, 2006, 1:04pm UTC](https://techcommunity.softwareag.com/t/logging-for-natural/61613/3 "2006-10-25T13:04:12Z")

</div>

Mark,

what you offer is, in my opinion, not a utility but a crutch. You can’t do this in normal production environment (can you change source code in production environments?). I would like a logging implemented into the natural runtime system. If necessary, it could be switched on even in production environments. This functionality could then also be used for a good debugger (as the current debugger only offers very very basic functions).

Just my opinion

---

<div class="post-metadata">

**Author:** ![Mark\_Barnard](https://avatars.discourse-cdn.com/v4/letter/m/bc8723/32.png) [@Mark\_Barnard](https://techcommunity.softwareag.com/u/Mark_Barnard)\
**Post date:** [October 31, 2006, 2:35am UTC](https://techcommunity.softwareag.com/t/logging-for-natural/61613/4 "2006-10-31T02:35:54Z")

</div>

Hi Wilfried,

You make some very valid points, but I was comparing this to log4j which also does something very similar in that you are required to add the logging statements to source code. At runtime you decide if logging is enabled or not, and if it’s disabled there is little to no performance hit. This is very similar to the way the Construct utilities work.

Regards,  
Mark

---

<div class="post-metadata">

**Author:** ![Darrell](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@Darrell](https://techcommunity.softwareag.com/u/Darrell)\
**Post date:** [May 26, 2007, 12:24am UTC](https://techcommunity.softwareag.com/t/logging-for-natural/61613/5 "2007-05-26T00:24:18Z")

</div>

What is wrong with the original propopsal of using RDC from within the Natural nucleus? Using the “U” (user) type requests you can start, stop, and log, anything you want.

The “U” type RDC call can be for any application-defined event you like. It can always be written to the RDC wrap-around buffer. When you want to see them, send a special “U” record (and this can be from any natural session, even a remote one). The purpose of the special “U” request migh to log those events to a specific destination such as a file, or system log, or a CICS TDQ or even a SYSVIEW history log. Whatever destination you choose.

Such a facility would be relatively easy to code.  
[/quote]

---

<div class="post-metadata">

**Author:** ![mwessjoh](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@mwessjoh](https://techcommunity.softwareag.com/u/mwessjoh)\
**Post date:** [March 15, 2012, 11:44am UTC](https://techcommunity.softwareag.com/t/logging-for-natural/61613/6 "2012-03-15T11:44:11Z")

</div>

Hi,

we published tha Logging-Framework on Sourceforge:

> **[NatUnit](https://sourceforge.net/projects/natunit/)**
>
> Download NatUnit for free. Unit-Test-Framework for Natural (SAG) NatUnit is a Unit-Test-Framework for Natural. Natural is a 4GL programming language from Software AG (SAG).

Feel free to download and using it.

We liked if you are helping use to improve the Logging-Framework.

Best regards,

Markus Wessjohann

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:40pm UTC](https://techcommunity.softwareag.com/t/logging-for-natural/61613/7 "2021-04-02T14:40:54Z")

</div>


