Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 365974 - Need ability to configure jetty Log on android
Summary: Need ability to configure jetty Log on android
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: other (show other bugs)
Version: 7.5.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 7.5.x   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-07 18:23 EST by Joakim Erdfelt CLA
Modified: 2011-12-08 12:42 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joakim Erdfelt CLA 2011-12-07 18:23:13 EST
When using jetty-client or websocket-client on android, it is very difficult to setup jetty Log as it requires System properties to configure itself.
(system properties are not a viable way to setup and configure anything on Android)
Comment 1 Joakim Erdfelt CLA 2011-12-08 12:42:52 EST
The techniques established by i-jetty project helps.

Using the AndroidLog from i-jetty and some pre-emptive setting of the Log
before Jetty initializes lets Jetty log be setup appropriately.

AndroidLog from i-jetty source (ASL/EPL Licensed)
http://code.google.com/p/i-jetty/source/browse/trunk/i-jetty/i-jetty-server/src/main/java/org/mortbay/ijetty/log/AndroidLog.java

The following bridging code should be placed in your Activity#onCreate() method

// Bridge Jetty Logging to Android Logging
System.setProperty("org.eclipse.jetty.util.log.class",AndroidLog.class.getName());
org.eclipse.jetty.util.log.Log.setLog(new AndroidLog());