Thanks,
It is working now... I had written /test/output.txt instead of
test/output.txt then it was not finding the path correctly.
Silly mistake!


>>> [EMAIL PROTECTED] 30/03/2006 17:59 >>>
Does the directory "test" exist?

try putting the absolute path to the log file, i.e.
"/home/silvana/test/output1.txt"

On 3/30/06, Silvana Lima <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Sorry to border you.
> I found your tutorial about Log4J very useful to me, but I am having
> troubles to implement a FileAppender solution.
> I need exactly what you did, but with a different path to the log
file. So
> I tryed to put a directory before the file name. But it doesnt work.
How can
> I do this?
>
> import org.apache.log4j.Level;
> import org.apache.log4j.Logger;
> import org.apache.log4j.SimpleLayout;
> import org.apache.log4j.FileAppender;
> public class simpandfile {
>    static Logger logger = Logger.getLogger(simpandfile.class);
>    public static void main(String args[]) {
>       SimpleLayout layout = new SimpleLayout();
>
>       FileAppender appender = null;
>       try {
>          appender = new
FileAppender(layout,"test/output1.txt",false);
> //it doesnt work with the path, only without
>       } catch(Exception e) {}
>
>       logger.addAppender(appender);
>       logger.setLevel((Level) Level.DEBUG);
>
>       logger.debug("Here is some DEBUG");
>       logger.info("Here is some INFO");
>       logger.warn("Here is some WARN");
>       logger.error("Here is some ERROR");
>       logger.fatal("Here is some FATAL");
>    }
> }
>
> Thanks for the help.
> Silvana.
>
>
>
>
>
>
--------------------------------------------------------------------------------------------------------
> O conteúdo desta mensagem e de seus anexos é de uso restrito e
> confidencial, sendo o seu sigilo protegido por lei. Estas informações
não
> podem ser divulgadas sem prévia autorização escrita. Se você não é o
> destinatário desta mensagem, ou o responsável pela sua entrega,
apague-a
> imediatamente e avise ao remetente, respondendo a esta mensagem.
Alertamos
> que esta mensagem transitou por rede pública de comunicação,
estando,
> portanto, sujeita aos riscos inerentes a essa forma de comunicação.
A
> QUALITY SOFTWARE não se responsabiliza por conclusões, opiniões, ou
outras
> informações nesta mensagem que não tenham sido emitidas por seus
> integrantes.
>
>
> This e-mail and any attachments are confidential and may also be
> privileged. If you are not the named recipient, please notify the
sender
> immediately and do not disclose the contents to any other person, use
it for
> any purpose, or store or copy the information. In the event of any
technical
> difficulty with this email, please contact the sender. QUALITY
SOFTWARE is
> not responsible for conclusion, opinions or any kind of information
in this
> message that doesn't come from our personnel.
>
>
--------------------------------------------------------------------------------------------------------
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED] 
> For additional commands, e-mail: [EMAIL PROTECTED] 
>
>


--
Javier González Nicolini


--------------------------------------------------------------------------------------------------------
O conteúdo desta mensagem e de seus anexos é de uso restrito e confidencial, 
sendo o seu sigilo protegido por lei. Estas informações não podem ser 
divulgadas sem prévia autorização escrita. Se você não é o destinatário desta 
mensagem, ou o responsável pela sua entrega, apague-a imediatamente e avise ao 
remetente, respondendo a esta mensagem. Alertamos que esta mensagem transitou 
por rede pública de comunicação, estando, portanto, sujeita aos riscos 
inerentes a essa forma de comunicação. A QUALITY SOFTWARE não se responsabiliza 
por conclusões, opiniões, ou outras informações nesta mensagem que não tenham 
sido emitidas por seus integrantes.


This e-mail and any attachments are confidential and may also be privileged. If 
you are not the named recipient, please notify the sender immediately and do 
not disclose the contents to any other person, use it for any purpose, or store 
or copy the information. In the event of any technical difficulty with this 
email, please contact the sender. QUALITY SOFTWARE is not responsible for 
conclusion, opinions or any kind of information in this message that doesn’t 
come from our personnel.
--------------------------------------------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to