Use absolute file name to do that, as the your servers current directory is
not set that is why defaulting to winnt\system32 directory.

-----Original Message-----
From: Jan Arenö [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 31, 2002 10:28 AM
To: [EMAIL PROTECTED]
Subject: Logfile directory


Hi

I have a LogFile Class that writes a specific log if I set a debug variable
to true. When I compile it at my local mashine (JDeveloper) it is written to
the basedirectory of the classes. But when I upload them to the apache
webserver (Oracles default web/jspserver) it writes the log to the
winnt\system32 directory. How do I force it to write to a specific directory
based on the class file (example a log directory under the directory that
the Logger.class is placed in)?

Code

    FileOutputStream fos = null;
    try
    {
      File f = new File(pFile);
      if(!f.exists())
      {
        fos = new FileOutputStream(f);
      }
      else
      {
        fos = new FileOutputStream(pFile, true);
      }

      pText += "\n";
      fos.write( (new Date( System.currentTimeMillis() ).toString() + " :
["+ pFunction +"] " + pText).getBytes() );
    }
    catch(Exception e) { /* Do nothing */ }
    finally
    {
      try
      {
        fos.close();
      }
      catch(Exception e) { /* Do nothing */ }
    }

Thanks for any help
Jan Arenö

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set
JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com


"The information in this e-mail, and any attachment therein, is 
confidential and for use by the addressee only. If you are not the 
intended recipient, please return the e-mail to the sender and delete 
it from your computer. Although The Bank of New York attempts to 
sweep e-mail and attachments for viruses, it does not guarantee that 
either are virus-free and accepts no liability for any damage sustained 
as a result of viruses." 

==========================================================================To 
unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to