blob: 337734f6b3c59743f0387fcc59efc537afd7d75f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
/*
* Oreka -- A media capture and retrieval platform
*
* Copyright (C) 2005, orecx LLC
*
* http://www.orecx.com
*
* This program is free software, distributed under the terms of
* the GNU General Public License.
* Please refer to http://www.gnu.org/copyleft/gpl.html
*
*/
/**
*
*/
package net.sf.oreka.services;
import java.util.*;
import java.io.*;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
public class Startup {
static Logger logger = Logger.getLogger(Startup.class);
public Startup() {
logger.log(Level.WARN, "Initializing orkweb");
InputStream is = this.getClass().getClassLoader().getResourceAsStream("log4j.properties");
if (is != null)
{
Properties properties = new Properties();
try
{
properties.load(is);
PropertyConfigurator.configure(properties);
}
catch (IOException e)
{
logger.log(Level.INFO, "log4j.properties not found");
}
}
//PropertyConfigurator.configure("log4j.properties");
/*
//InputStream s = ClassLoader.getSystemResourceAsStream("toto.txt");
InputStream s = this.getClass().getClassLoader().getResourceAsStream("toto.txt");
if (s != null)
{
logger.log(Level.INFO, "~~~~~~~~ yes");
}
else
{
logger.log(Level.INFO, "~~~~~~~~ no");
}
*/
}
}
|