Java - Log4j

 
Vista:

Log4j

Publicado por Carol (1 intervención) el 22/02/2006 16:29:20
Descomprimi log4j en el directorio C:\logging-log4j-1.2.13.
Creé la variable de ambiente LOG4J_HOME = C:\logging-log4j-1.2.13
Y agregué en classpath C:\logging-log4j-1.2.13\dist\lib\log4j-1.2.6.jar;

Alguien sabe porqué cuando compilo el programa que pongo abajo me aparece el siguiente error :
hellolog.java:1: package org.apache.log4j does not exist
import org.apache.log4j.Logger;
^
hellolog.java:2: package org.apache.log4j does not exist
import org.apache.log4j.BasicConfigurator;
^
hellolog.java:7: cannot find symbol
symbol : class Logger
location: class hellolog
static Logger logger=Logger.getLogger(Hellolog.class);
^
hellolog.java:7: cannot find symbol
symbol : class Hellolog
location: class hellolog
static Logger logger=Logger.getLogger(Hellolog.class);
^
hellolog.java:7: cannot find symbol
symbol : variable Logger
location: class hellolog
static Logger logger=Logger.getLogger(Hellolog.class);
^
hellolog.java:11: cannot find symbol
symbol : variable BasicConfigurator
location: class hellolog
BasicConfigurator.config
ure();
^
6 errors

PROGRAMA:

import org.apache.log4j.Logger;
import org.apache.log4j.BasicConfigurator;

public class hellolog
{

static Logger logger=Logger.getLogger(Hellolog.class);

public static void main(String argv[])
{
BasicConfigurator.configure();
logger.debug("Hola");
logger.info("Como has estado");
}
}

GRACIAS POR SU AYUDA!!
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Log4j

Publicado por oscar (1 intervención) el 21/03/2006 03:43:03
me supongo que te esta marcando que no encuentra la libreria, si estas usando un IDE debes hacer que el classpath de Java de dicho IDE apunte al jar de log4j.espero que te ayude en algo.suerte
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar