Skip to content

Commit f9ff419

Browse files
authored
Merge pull request #594 from chadlwilson/disable-log-escaping
fix: disable escaping in Jetty logging for executable wars by default
2 parents 3a0debf + 56d4d41 commit f9ff419

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lib/warbler/web_server.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,10 @@ def add(jar)
113113
args4 = --config
114114
args5 = {{config}}
115115
args6 = {{warfile}}
116-
props = jetty.home,org.eclipse.jetty.util.log.class
116+
props = jetty.home,org.eclipse.jetty.util.log.class,org.eclipse.jetty.util.log.stderr.ESCAPE
117117
jetty.home = {{webroot}}
118118
org.eclipse.jetty.util.log.class = org.eclipse.jetty.util.log.StdErrLog
119+
org.eclipse.jetty.util.log.stderr.ESCAPE = false
119120
PROPS
120121
end
121122
end

spec/warbler/web_server_spec.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,14 @@ def server = Warbler::JettyServer.new
6161
.each_line(chomp: true)
6262
.to_h { |line| line.split(' = ', 2) }
6363

64-
expect(props.keys.to_set).to eql Set.new(['mainclass', 'args', 'args0', 'args1', 'args2', 'args3', 'args4', 'args5', 'args6', 'props', 'jetty.home', 'org.eclipse.jetty.util.log.class'])
64+
expect(props.keys.to_set).to eql Set.new(
65+
['mainclass', 'args', 'args0', 'args1', 'args2', 'args3', 'args4', 'args5', 'args6', 'props', 'jetty.home',
66+
'org.eclipse.jetty.util.log.class', 'org.eclipse.jetty.util.log.stderr.ESCAPE']
67+
)
6568

6669
expect(props['mainclass']).to eq 'org.eclipse.jetty.runner.Runner'
67-
expect(props['props']).to eq 'jetty.home,org.eclipse.jetty.util.log.class'
70+
expect(props['props']).to eq 'jetty.home,org.eclipse.jetty.util.log.class,org.eclipse.jetty.util.log.stderr.ESCAPE'
6871
expect(props['org.eclipse.jetty.util.log.class']).to eq 'org.eclipse.jetty.util.log.StdErrLog'
72+
expect(props['org.eclipse.jetty.util.log.stderr.ESCAPE']).to eq 'false'
6973
end
7074
end

0 commit comments

Comments
 (0)