-
Notifications
You must be signed in to change notification settings - Fork 14
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
Common Logging Format for Zowe Services #90
Comments
Hello @MarkAckert, @1000TurquoisePogs, @stevenhorsman, @Joe-Winchester, @JirkaAichler! I have tried to draft a common logging format that we could use in our services. What do you think about it? |
what about
|
I like it! |
I think it looks good - it seems to have all the info and then consistency is the main thing. |
My take on this is that messages that require user action should have message IDs. Typically, all errors should have the message ID and most of the warnings. Currently, we put all the messages to the spool via stdout. But we want to move most of the logs to log files and keep only important messages (errors, important warnings) related to the operational aspect of the services in the spool. In the end, all messages in the spool should have message IDs. In case of API gateway, it makes sense to have the log files split in the same way as other proxies or HTTP servers do (e.g. Nginx or Apache HTTP Server) and have "access log" with every access logged an error log (only the failed requests: 4xx, 5xx). In any case, a consistent format will be useful and especially now when everything is in one place. |
I have made few updates to the format according to Vitek's suggestions. They were very useful in a product that we worked on in the past. |
@plavjanik I like your recommended formats. Some other items for when a msgid is required. Console Data that is trace data doesn't need message ids, but, it would be good to have a common format for all components so that log aggregation would be possible and ultimately tools like Splunk / ELK would be easier to exploit |
@plavjanik to update and present at the next architecture call. |
@plavjanik how flexible is this new format planned to be? For example, in the cross memory server messages that go to SYSPRINT and SYSLOG, we have additional components we need, like the ASCB, ASID and user ID of the caller application. On the other hand, the severity is expressed by the message ID suffix (E, W, I).
|
Move to community for implementation |
Here is a prototype I have: tn3270-ng2 app in browser: PR: zowe/zlux-shared#17 and zowe/zlux-server-framework#116 and zowe/zlux-app-manager#119 I took liberties on the browser side: there is no thread or user ID to give, and since the entirety of the desktop logging would be about desktop apps, wouldn't the ID always start with ZWED? |
Updated to swap out user ID for name... process.geteuid versus os.userInfo.username |
Let's use userID = username, and locationInformation = loggername,filename:linenumber Examples Java: nodejs Server: Browser: In the case of the node server & browser, we don't know filename or line number from the logger. |
Time: we should use UTC. How does imperative & browser align with server logs? |
Though there is no threadID, for browser I started to think that browser+version would be important to know right in the log, so it could be printed at the beginning - not really important to know in each line. |
Here is my alternative to
I can imagine implementation of such IDs might take some time so we can start with |
I found that v8 (chrome, nodejs) does have a way of getting file & line number, etc, for location. Firefox doesn't as far as I can tell. Updated PR with nodejs specific coding for the JS logger. |
Had a review of this concept and one point brought up was that use of the term "FATAL" instead of similar-meaning words could be taken the wrong way. The issue is that hospitals (some are big DB2 users) take the meaning of FATAL very seriously. A less sensitive term to use would be "SEVERE" or "UNRECOVERABLE", or "CRITICAL". |
Let's use "CRITICAL" above "ERROR". |
@1000TurquoisePogs Good point.
|
Signed-off-by: Vitek Vlcek <vitezslav@vvvlcek.info>
Signed-off-by: vvvlc <vitezslav+github@vvvlcek.info> disable banner based on zowe/zac#90 (comment)
Signed-off-by: vvvlc <vitezslav+github@vvvlcek.info> disable banner based on zowe/zac#90 (comment) Signed-off-by: Vitek Vlcek <vitezslav@vvvlcek.info>
Signed-off-by: Vitek Vlcek <vitezslav@vvvlcek.info>
banner cannot be enabled because it is displayed twice see spring-projects/spring-boot#17746 Signed-off-by: Vitek Vlcek <vitezslav@vvvlcek.info>
banner cannot be enabled because it is displayed twice see spring-projects/spring-boot#17746 Signed-off-by: Vitek Vlcek <vitezslav@vvvlcek.info>
#341) * disable banner based on proposal in zowe/zac#90 (comment) banner cannot be enabled because it is displayed twice see spring-projects/spring-boot#17746
Need to create a process of clearing information to the sub-projects. |
@1000TurquoisePogs - with the move to make the Zowe runtime read only (so that we can use USS mountpoints for SMP/E and also wipe and replace with PTFs) there is a configuration directory that is introduced in 1.5. This is where the api-defs for static definition has moved to. It'd be great to move the zlux-app-server/log files also here. Is there a way to specify a parm to nodeserver.sh and nodecluster.sh to use an alternative log folder ? |
After ZLC discussion today (March 18 2020) it was decided to close this issue as complete - will reopen or create new issues if additional work needed. |
History
Each component has a different format (layout) of log messages that are stored in the log. They have different origin and there is no standard.
The major messages are written to the STDOUT DDNAME of the Zowe address space and the output looks inconsistent.
There following types:
No format - plain message (shell scripts that are starting Zowe processes or services prior their logging library is initialized):
APIML - Spring Boot default format (via Logback - https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot/src/main/resources/org/springframework/boot/logging/logback/defaults.xml)
z/OS Services (Explorers)
zLUX:
Problems:
Proposal
Example:
2019-03-19 11:23:57.776 <ZWEAGW1:threadInformation> userID INFO (locationInformation) ZWEA001I Message text
Components of the message:
pfxSnnnI
wherepfx
is Zowe prefix (ZWE
,S
is the subsystem identifier as defined in https://github.com/zowe/zlc/blob/master/process/messageManagement.md (e.g.A
for API ML),nnn
is the service ID (e.g.DS
for Discovery Service,
GW
for the gateway),I
is the number of the instance (in high-available more) -1
by defaultyyyy-MM-dd HH:mm:ss.SSS
in the timezone of the z/OS system (put it first)(filename:line)
TRACE
- Very detailed information, used only when diagnosing difficult problems. Not printed by defaultDEBUG
- Detailed information, typically of interest only when diagnosing problems. Not printed by defaultINFO
- Confirmation that things are working as expectedWARN
- An indication that something unexpected happened, or indicative of some problem in the near future but the service is still working as expectedERROR
- Due to a more serious problem, the service has not been able to perform some functionFATAL
- A serious error, indicating that the service itself may be unable to continue runningRecommended libraries:
No banners.
Related to #73 and #75
The text was updated successfully, but these errors were encountered: