-
Notifications
You must be signed in to change notification settings - Fork 133
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
Issue WTO message on API Mediation Layer startup #3894
Merged
Merged
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d4704d0
Initial version of the WTO message requirements.
balhar-jakub 1d8ec38
Correct the shortening of the message
balhar-jakub 07093a1
Merge branch 'master' into balhar-jakub/apiml/wto-message
balhar-jakub ce8c286
language refactoring
janan07 5a114e3
clarrification
janan07 58bf7ee
Reflect concerns from Andrew
balhar-jakub 58c473b
language/formatting refactor
janan07 a59ad44
Update wto-message-on-startup.md
balhar-jakub 984bcdf
fix typo
janan07 c6b192e
resync branches
janan07 05993ba
add wto-message to sidebars.js
janan07 e064cc6
fix broken links
janan07 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
108 changes: 108 additions & 0 deletions
108
docs/user-guide/api-mediation/wto-message-on-startup.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
# Configuring initial API Mediation Layer startup message for Syslog | ||
|
||
:::info Role: system programmer | ||
::: | ||
|
||
:::note Functionality of this feature is available from Zowe 2.18. | ||
::: | ||
|
||
Startup of the API Mediation Layer can be configured to present a message in the Syslog that the API Mediation Layer is started and ready. This setup is typically used in combination with Workload Automation tools to manage the lifecycle of Zowe. | ||
|
||
This functionality requires the following changes to the zowe.yaml: | ||
|
||
1. Change the property `zowe.sysMessages` by adding the value `- "ZWEAM001I"` | ||
``` | ||
zowe: | ||
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> | ||
# You can define any Zowe message portions to be checked for and the message added to the | ||
# system log upon its logging, truncated to 126 characters. | ||
sysMessages: | ||
- "ZWEAM001I" | ||
``` | ||
This property change ensures that the message containing `ZWEAM001I` is presented in the Syslog. | ||
|
||
**Example of the Syslog:** | ||
|
||
`2024-09-30 10:17:53.814 <ZWEAGW1:DiscoveryClient-InstanceInfoReplicator-%d:3335> jb892003 INFO ((o.z.a.g.c.GatewayHealthIndicator)) ZWEAM001I API Mediation Layer started` | ||
|
||
2. Prepare custom logging configuration. | ||
The current default logging implementation starts with information about the current time. This message content is unlike the message id which is typical in z/OS. To change this message behavior, it is necessary to change the logback.xml configuration. The following example shows the custom logback.xml which prepends the message with the first 9 characters of the message. | ||
|
||
**Example:** | ||
|
||
``` | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<configuration> | ||
<property resource="application.yml" /> | ||
<property name="MAX_INDEX" value="${rollingPolicy.maxIndex:-12}"/> | ||
<property name="MIN_INDEX" value="${rollingPolicy.minIndex:-1}"/> | ||
<property name="MAX_FILE_SIZE" value="${rollingPolicy.file.maxSize:-50MB}"/> | ||
<property name="STORAGE_LOCATION" value="${apiml.logs.location}" /> | ||
<property name="apimlLogPattern" value="%.-9msg %d{yyyy-MM-dd HH:mm:ss.SSS,UTC} %clr(<${logbackService:-${logbackServiceName}}:%thread:${PID:- }>){magenta} %X{userid:-} %clr(%-5level) %clr(\\(%logger{15}\\)){cyan} %msg%n"/> | ||
|
||
<turboFilter class="org.zowe.apiml.product.logging.UseridFilter"/> | ||
<if condition='property("spring.profiles.include").contains("debug")||property("spring.profiles.include").contains("diag")||property("spring.profiles.include").contains("dev")'> | ||
<then> | ||
</then> | ||
<else> | ||
<turboFilter class="org.zowe.apiml.product.logging.ApimlDependencyLogHider"/> | ||
<turboFilter class="org.zowe.apiml.product.logging.LogLevelInfoFilter"/> | ||
<turboFilter class="ch.qos.logback.classic.turbo.DuplicateMessageFilter"> | ||
<AllowedRepetitions>0</AllowedRepetitions> | ||
</turboFilter> | ||
</else> | ||
</if> | ||
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" /> | ||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | ||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder"> | ||
<layout class="org.zowe.apiml.product.logging.MaskingLogPatternLayout"> | ||
<pattern>${apimlLogPattern}</pattern> | ||
</layout> | ||
</encoder> | ||
</appender> | ||
|
||
<appender name="FILE" class="org.zowe.apiml.product.logging.ApimlRollingFileAppender"> | ||
<file>${STORAGE_LOCATION}/${logbackServiceName}.log</file> | ||
|
||
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> | ||
<fileNamePattern>${STORAGE_LOCATION}/${logbackServiceName}.%i.log</fileNamePattern> | ||
<minIndex>${MIN_INDEX}</minIndex> | ||
<maxIndex>${MAX_INDEX}</maxIndex> | ||
</rollingPolicy> | ||
|
||
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> | ||
<maxFileSize>${MAX_FILE_SIZE}</maxFileSize> | ||
</triggeringPolicy> | ||
|
||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder"> | ||
<layout class="org.zowe.apiml.product.logging.MaskingLogPatternLayout"> | ||
<pattern>${apimlLogPattern}</pattern> | ||
</layout> | ||
</encoder> | ||
</appender> | ||
|
||
<root level="INFO"> | ||
<appender-ref ref="STDOUT" /> | ||
<appender-ref ref="FILE" /> | ||
</root> | ||
</configuration> | ||
``` | ||
Custom configuration that changes the structure of the message to prepend 9 characters to the beginning is prepared. | ||
|
||
:::tip | ||
For detailed information about how to provide this changed configuration, see [Customizing Zowe API Mediation Layer logging](./configuration-logging.md). | ||
::: | ||
|
||
3. Validate that API Mediation Layer properly uses this new configuration for the Gateway service, which issues the message that the API Mediation Layer started. | ||
|
||
``` | ||
components: | ||
gateway: | ||
logging: | ||
config: /path/to/logback.xml | ||
``` | ||
|
||
You successfully changed the structure of the log message if you see the message `ZWEAM001I` in the Syslog when the API Mediation Layer fully starts and is ready to handle requests. | ||
|
||
**Message example:** | ||
`ZWEAM001I 2024-09-30 10:17:53.814 <ZWEAGW1:DiscoveryClient-InstanceInfoReplicator-%d:3335> jb892003 INFO ((o.z.a.g.c.GatewayHealthIndicator)) ZWEAM001I API Mediation Layer started` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please provide a single line description of what this configuration is? Is this an example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to change it.