Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: syslog logging in libcob #106

Open
lefessan opened this issue Jul 6, 2023 · 4 comments
Open

feature request: syslog logging in libcob #106

lefessan opened this issue Jul 6, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@lefessan
Copy link
Member

lefessan commented Jul 6, 2023

Some of our customers are used to having COBOL programs being automatically monitored by their mainframe (usually issuing stop/start events, I-O stats and unexpected errors).

So, I am thinking about adding something like that into libcob. The idea would be:

  • To have an env variable like COB_SYSLOG that can be set by the user/system
  • The content of this variable would be used as some kind of bitmap to decide which events should be sent to syslog, and as which facility (for example, 'j' would be start/stop events, 'f' for file input-output, 'e' for errors, etc.)

@GitMensch Do you have an opinion on that ? Would it be ok as a contribution to GnuCOBOL ? Do you have requirements or nice-to-have features that could fit such a proposal ?

@lefessan lefessan added the enhancement New feature or request label Jul 6, 2023
@GitMensch
Copy link
Collaborator

This is a useful discussion - and it belongs to the gnucobol dev list, please send it there.
If we add syslogging (which should be an optional feature, otherwise it should go to a logging file) then this may be better a configurable target than a single one, and this would also apply to current output (like runtime warnings/errors), but I'm not sure if this should be additional or "only".
Maybe something like COB_LOGGING=warnings(stderr,syslog[libcob_warn]),errors(stderr,syslog[libcob_err],file[/opt/log/$$.err]),iotrace(stderr)?

Even with syslogd allowing to also send output to a file a "direct" write will always be faster.

In GixSQL spdlog is used, but that is C11++, so out of scope.
With syslog the question is always what to do on Win32, I guess there are C syslog wrappers that would write to the event list, but I don't know.

Or "just add" syslog as a target, maybe with optional [name] for all configurable output files from runtime.cfg, which would only be available if configure finds the necessary header/function + additional output files for things like start/stop (if set, then output is done, otherwise it isn't)?

As noted: in general that should be sent to the dev mailing list, please put some additional thoughts (not a full design) and maybe outline 2 possible approaches in your mail.

@lefessan
Copy link
Member Author

lefessan commented Jul 6, 2023

I don't think I have access to a dev-only mailing list on GnuCOBOL. I just registered to a few mailing lists, but they seem to be for users.

@GitMensch
Copy link
Collaborator

That was correct, sorry. You're now the speaker of this repo to the GC dev group :-)

@GitMensch
Copy link
Collaborator

Note: for module loading/unloading and environment and file there's even and old related FR: https://sourceforge.net/p/gnucobol/feature-requests/270/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants