On 18/11/2016 14:27, Achim Nierbeck wrote:
Hi Tim,
as JB already said, that's part of the configuration.
For more details on how to use Pax-Web can be found here [1].
I tried that, setting some of the |org.ops4j.pax.web.log.ncsa.*|
properties, it didn't work. *Exactly* what properties do I have to set
to turn on request logging?
Also keep in mind, as Pax-Web is a HttpService it's configuration
should first be configured by the HttpService configuration,
found in the org.ops4j.pax.web config file, like port etc.
Yes, I've managed to set the port, via configuration\configuration.json.
I don't mind where or how I set configuration, I'm quite prepared to
take advice on doing it the "best" or "correct" way, but at present I
don't have *any* way at all that actually works, which is why I'm
clutching at all the straws I can find on the web.
Only for enhanced configurations you should use jetty.xml.
Another point here, the jetty.xml uses some slight different
configuration syntax, as you configure an already startet
Jetty instead of configuring a fresh Jetty.
For example do
<Callname="addConnector">
or
<Get name="handler">
<Call name="addHandler">
to adapt the configuration.
A complete jetty.xml can be found here [2].
Yes, I found that, but what I haven't found is an example telling me how
to turn on request logging.
And I really did think that putting deliberate errors into the jetty.xml
would cause errors to be reported, and that, therefore, the lack of any
errors being reported indicated that the jetty.xml wasn't being read by
anything. which would be consistent with the ncsa properties not working
either if nothing were reading the entire org.ops4j.pax.web.cfg file.
regards, Achim
[1] - http://ops4j.github.io/pax/web/SNAPSHOT/User-Guide.html
[2] -
https://github.com/ops4j/org.ops4j.pax.web/blob/master/samples/jetty-config-fragment/src/main/resources/jetty.xml
2016-11-18 15:16 GMT+01:00 Jean-Baptiste Onofré <[email protected]
<mailto:[email protected]>>:
Hi Tim,
when you install the jetty feature, you can override the default
configuration using etc/org.ops4j.pax.web.cfg.
This cfg file can refer to a jetty.xml using:
org.ops4j.pax.web.config.file=${karaf.base}/etc/jetty.xml
Then the etc/jetty.xml is a jetty file.
Regards
JB
On 11/18/2016 03:11 PM, Tim Ward wrote:
Very simple, I hope, but days of research haven't found an
answer that
works yet.
How do change the configuration of Jetty in Karaf? As the simplest
possible initial beginner's question, how do I turn on request
logging?
The osgi-dev mailing list referred me here.
(I can actually see what it's doing with requests by setting
the log
level to DEBUG in org.ops4j.pax.logging.cfg and then looking in
data\log\karaf.log, but given the volume and format of output
that's not
a practical solution.
I've tried putting stuff like
org.ops4j.pax.web.log.ncsa.format=yyyy_mm_dd.request.log in
org.ops4j.paw.web.cfg but that doesn't seen to do anything.
I've tried creating a gibberish jetty.xml, pointed to by
org.ops4j.pax.web.config.file in org.ops4j.paw.web.cfg, in the
hope of
getting some error messages about the gibberish, showing that
at least
something was reading the jetty.xml, but that didn't work. It
didn't
work doing the same via configuration.json either.
I haven't really found any actual *documentation* of any of
the above,
just snippets of example code, so all my attempts were
probably wrong
anyway.)
--
Tim Ward
--
Jean-Baptiste Onofré
[email protected] <mailto:[email protected]>
http://blog.nanthrax.net
Talend - http://www.talend.com
--
Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
Committer & Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
Software Architect / Project Manager / Scrum Master
--
Tim Ward