commit | author | age
|
15ed25
|
1 |
package de.uhilger.avdirektor.handler; |
U |
2 |
|
|
3 |
import com.sun.net.httpserver.HttpExchange; |
|
4 |
import de.uhilger.avdirektor.OMXLogLeser; |
|
5 |
import java.io.File; |
|
6 |
import java.io.IOException; |
|
7 |
import java.util.logging.Level; |
|
8 |
import java.util.logging.Logger; |
|
9 |
|
|
10 |
/** |
|
11 |
* |
|
12 |
* @author ulrich |
|
13 |
*/ |
|
14 |
public class LogHandler extends AbstractHandler { |
|
15 |
|
|
16 |
private static final Logger logger = Logger.getLogger(LogHandler.class.getName()); |
|
17 |
|
|
18 |
@Override |
|
19 |
protected String process(HttpExchange t, String params) { |
|
20 |
OMXLogLeser leser = new OMXLogLeser(); |
|
21 |
String lines = "Log nicht lesbar."; |
|
22 |
try { |
|
23 |
lines = leser.lesen(new File("/home/ulrich/work/avd/omxplayer.log")); |
|
24 |
} catch (IOException ex) { |
|
25 |
Logger.getLogger(LogHandler.class.getName()).log(Level.SEVERE, null, ex); |
|
26 |
} |
|
27 |
return lines; |
|
28 |
} |
|
29 |
|
|
30 |
} |