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

[WFCORE-6579] Allow process controller log file capture initial manag… #5789

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

yersan
Copy link
Collaborator

@yersan yersan commented Dec 4, 2023

…ed process Standard Out and Err

Jira issue: https://issues.redhat.com/browse/WFCORE-6579

@yersan
Copy link
Collaborator Author

yersan commented Dec 4, 2023

CC @bstansberry / @jamezp I ended up with the above, let me know your thoughts, thanks!

@github-actions github-actions bot added the deps-ok Dependencies have been checked, and there are no significant changes label Dec 4, 2023
@wildfly-ci
Copy link

Core -> WildFly Preview Integration Build 13125 outcome was UNKNOWN using a merge of e7e7033
Summary: Canceled (Exit code 143 (Step: Build & test full (Maven)) (new)) Build time: 00:06:40

@wildfly-ci
Copy link

Core -> Full Integration Build 13056 outcome was UNKNOWN using a merge of e7e7033
Summary: Canceled (Exit code 1 (Step: Build & test full (Maven))) Build time: 00:06:37

@wildfly-ci
Copy link

Core -> Full Integration Build 13285 outcome was UNKNOWN using a merge of e7e7033
Summary: Canceled (Tests passed: 1027, ignored: 5; exit code 143 (Step: Build & test full (Maven)) (new)) Build time: 00:06:45

Comment on lines 89 to 90
// Signalling the Process Controller to switch also the System.err is optional since after installing StdioContext,
// there won't be more logs sent to the standard Err.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thinking a bit more, although optional, the aggregation of the StdError and Stout and where they are redirected will be handled by the logging.configuration file, so assuming that both will be redirected to the Stout is weak, since I guess that can be changed via the logging configuration file and instead of using handler.CONSOLE.target=SYSTEM_OUT use handler.CONSOLE.target=SYSTEM_ERR, so probably this should be changed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

// This message is not used to display any information on the standard output, it signals the Process Controller
// to switch the standard output of this managed process from the process controller log to the process controller
// standard output.
// Once the StdioContext gets installed, both the stout and stderr of this managed process will be captured,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stdout instead of stout.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 129 to 130
logSystemErr = Logger.getMessageLogger(ProcessLogger.class, "org.jboss.as.process." + processName + ".system.err");
logSystemOut = Logger.getMessageLogger(ProcessLogger.class, "org.jboss.as.process." + processName + ".system.out");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not critical, should we use stdout and stderr instead? I don't have a strong opinion, I'm just curious :)

We also might want to consider the order to have the process name last to make filtering easier. For example you could just skip stdout with logger.org.jboss.as.process.system.out.level=WARN

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not critical, should we use stdout and stderr instead?

I am fine with both. xxx.system.out and xxx.system.err are very intuitive to me due to the similitude with the Java methods, if xxx.system.stdout and xxx.system.stderr are more related to logging world, I am fine with them too. I do not have any preference.

We also might want to consider the order to have the process name last to make filtering easier. For example you could just skip stdout with logger.org.jboss.as.process.system.out.level=WARN

Thanks, that's a smarter choice. I agree with you.

We already have the .status category defined as "org.jboss.as.process." + processName + ".status". Should we change it too?

That would make all the related categories consistent, although would affect existing configurations. However, since are logging categories, any existing configuration can be changed to adapt to the new version and that would not affect server behaviour, so I am in favor of adapting those three.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jamezp

I've changed the categories to xxx.system.stdout and xxx.system.stderr.

However, I left the "org.jboss.as.process." + processName + ".system.sterr" and "org.jboss.as.process." + processName + ".system.stout" as proposed originally since we already have "org.jboss.as.process." + processName + ".status" and users could be familiar with that category.

I prefer being conservative here since this is an enhancement and I don't want to introduce a change on the .status category or have categories working differently than the status one. I think the usage of them is unlikely, but if they are needed I think is preferable a consistent with what we previously have.

@wildfly-ci
Copy link

Core -> WildFly Preview Integration Build 13140 outcome was FAILURE using a merge of 5018b3a
Summary: Exit code 1 (Step: Build & test full (Maven)) (new) Build time: 00:02:04

@wildfly-ci
Copy link

Core -> Full Integration Build 13071 outcome was FAILURE using a merge of 5018b3a
Summary: Exit code 1 (Step: Build & test full (Maven)) (new) Build time: 00:02:06

@wildfly-ci
Copy link

Core -> Full Integration Build 13300 outcome was FAILURE using a merge of 5018b3a
Summary: Exit code 1 (Step: Build & test full (Maven)) (new) Build time: 00:03:15

Copy link
Contributor

@bstansberry bstansberry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll happily defer to you and @jamezp re the 'system.stdxxx' thing, but my input is just 'stdxxx' is best. Admins consume logs, and they may not even know about the Java System class. OTOH I expect a Java developer interested in domain logging would understand what stdout and stderr mean. Those are generic terms:

https://en.wikipedia.org/wiki/Standard_streams

@@ -107,7 +125,9 @@ enum State {
this.pcAuthKey = pcAuthKey;
isPrivileged = privileged;
respawnPolicy = respawn ? RespawnPolicy.RESPAWN : RespawnPolicy.NONE;
log = Logger.getMessageLogger(ProcessLogger.class, "org.jboss.as.process." + processName + ".status");
logStatus = Logger.getMessageLogger(ProcessLogger.class, "org.jboss.as.process." + processName + ".status");
logSystemErr = Logger.getMessageLogger(ProcessLogger.class, "org.jboss.as.process." + processName + ".system.sterr");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/sterr/stderr

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks!

log = Logger.getMessageLogger(ProcessLogger.class, "org.jboss.as.process." + processName + ".status");
logStatus = Logger.getMessageLogger(ProcessLogger.class, "org.jboss.as.process." + processName + ".status");
logSystemErr = Logger.getMessageLogger(ProcessLogger.class, "org.jboss.as.process." + processName + ".system.sterr");
logSystemOut = Logger.getMessageLogger(ProcessLogger.class, "org.jboss.as.process." + processName + ".system.stout");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/stout/stdout

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to

"org.jboss.as.process." + processName + ""

We don't want to mess with the existing 'status' and these should be consistent.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks!

@@ -121,6 +121,9 @@ public class CommandLineConstants {
public static final String PREFER_IPV4_STACK = "java.net.preferIPv4Stack";
public static final String PREFER_IPV6_ADDRESSES = "java.net.preferIPv6Addresses";

public static final String MANAGED_PROCESS_SYSTEM_ERROR_TO_LOG = "jboss.domain.managed-process.system.sterr.to.process-controller.log";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sterr should be stderr

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks!

@@ -121,6 +121,9 @@ public class CommandLineConstants {
public static final String PREFER_IPV4_STACK = "java.net.preferIPv4Stack";
public static final String PREFER_IPV6_ADDRESSES = "java.net.preferIPv6Addresses";

public static final String MANAGED_PROCESS_SYSTEM_ERROR_TO_LOG = "jboss.domain.managed-process.system.sterr.to.process-controller.log";
public static final String MANAGED_PROCESS_SYSTEM_OUT_TO_LOG = "jboss.domain.managed-process.system.stout.to.process-controller.log";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stout should be stdout

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks!

@yersan yersan added the ready-for-merge This PR is ready to be merged and fulfills all requirements label Dec 12, 2023
@yersan yersan merged commit f62fbf7 into wildfly:main Dec 12, 2023
12 checks passed
@yersan yersan deleted the WFCORE-6579 branch December 12, 2023 11:52
@yersan
Copy link
Collaborator Author

yersan commented Dec 12, 2023

Thanks @jamezp and @bstansberry !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deps-ok Dependencies have been checked, and there are no significant changes ready-for-merge This PR is ready to be merged and fulfills all requirements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants