-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Jetty 12.0.x 12191 debug listener #12231
Conversation
@olamy huh? what does this mean from https://jenkins.webtide.net/blue/organizations/jenkins/jetty.project/detail/PR-12231/2/pipeline ?
|
documentation/jetty/modules/operations-guide/pages/deploy/index.adoc
Outdated
Show resolved
Hide resolved
documentation/jetty/modules/operations-guide/pages/deploy/index.adoc
Outdated
Show resolved
Hide resolved
documentation/jetty/modules/operations-guide/pages/deploy/index.adoc
Outdated
Show resolved
Hide resolved
jetty-core/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/ContextProvider.java
Outdated
Show resolved
Hide resolved
for (Path file : envPropertyFiles) | ||
{ | ||
Path resolvedFile = parent.resolve(file); | ||
if (Files.exists(resolvedFile)) | ||
{ | ||
Properties tmp = new Properties(); | ||
try (InputStream stream = Files.newInputStream(resolvedFile)) |
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.
Aren't these meant to be merged into the single properties file and then that is checed properties with the prefix?
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 don't understand your question, if you look at lines 406 and 407 the properties are all added into the general property substitution pool:
try (InputStream stream = Files.newInputStream(resolvedFile))
{
tmp.load(stream);
//put each property into our substitution pool
tmp.stringPropertyNames().forEach(k -> properties.put(k, tmp.getProperty(k)));
…x.adoc Co-authored-by: Greg Wilkins <[email protected]>
…x.adoc Co-authored-by: Greg Wilkins <[email protected]>
@gregw can you also comment on how the |
jetty-core/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/ContextProvider.java
Outdated
Show resolved
Hide resolved
…x.adoc Co-authored-by: Greg Wilkins <[email protected]>
The DebugHandler exists in ee8/ee9 for backwards compatibility. All we need going forward is the Core DebugHandler. I'm not sure why the debuglog module was deprecated, but I assume it was because it does the same thing as the DebugListener. But DebugListener can only be used in a servlet context, so we would still need DebugHandler for core applications or to have a single debug log over multiple contexts. So perhaps remove the deprecation and explain a bit more about how they relate to each other. |
I've created PR #12254 as an alternative implementation which uses the As it stands with this PR, all debug logs from all contexts append to the same log file, however there is no over-arching locking, which will lead to problems. Ideally, each context would have its own debug log, but at the time at which debug is configured, nothing identifying about the context is known: we don't know the war file, or the context path for example. So to pursue this approach we would have to use eg the hashcode of the The alternate implementation in #12254 inserts only a single Yet another alternative solution that would allow us to have a debug log per context might be to configure the @gregw your thoughts? |
We are using slf4j, there's nothing preventing us from using a MDC or NDC to identify the context. |
MDC is thread local, so it won't work in general. |
I'm closing this PR in favour of PR #12254. The problem with this PR is that all contexts will share the same log file and it is difficult to see how to make them use a separate logfile in a way that would be meaningful to users. |
Closes #12191
This PR is to re-enable the Debug logging feature.
In order to do it, I had to extend the concept of the environment-specific context xml files such that we could define any number of
eeX-
properties files, naming xml files to be applied to the webapp being deployed.Prior to this change, you were only permitted to define a single
eeX.properties
file, containing a singleorg.eclipse.jetty.deploy.environmentXml
property pointing to either an absolute filename, or a filename relative to$jetty.base
.After this change, you may have any number of properties files prefixed by
eeX-
. Each one contains a property prefixed withorg.eclipse.jetty.deploy.environmentXml
that names a location of an absolute or$jetty.base
relative file.When there are multiple environment-specific xml files they are applied to the webapp being deployed in the ordering produced by the property names. So properties
org.eclipse.jetty.deploy.environmentXml.foo
andorg.eclipse.jetty.deploy.environmentXml.bar
properties will result in their context xml files being applied in the ordering:org.eclipse.jetty.deploy.environmentXml.bar
org.eclipse.jetty.deploy.environmentXml.foo
Having done the above, we can now deploy the EE specific Debug logging feature. There are modules for
ee8-debug
,ee9-debug
,ee10-debug
(and will beee11-debug
in jetty-12.1).Deployment documentation has also been updated to reflect the above.