-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lahiru,

On 6/20/12 5:39 PM, Lahiru Gunathilake wrote:
> Hi  Caldarale,
> 
> Its not a website.. I am hosting a middleware which will be used
> by scientist to run their application in the Grid. So Ideal
> scenario is like 2--30 requests per day but they are long running
> and very time consuming (Some jobs would take 2,3 days or one week
> to finish), so the logs are very important.

If you need requests to take 2-3 days, then HTTP is not the protocol
for you. Are you accepting batch requests via HTTP and then working on
them after the request/response has completed? That would make more sense.

In any case, most logging frameworks create "Log" (or Logger) objects
that live for a long time: they aren't set up to create a Log/Logger,
use it for a bit and then discard it, since loggers tend to get used
for the life of the JVM.

I think what you want is a simple FileWriter. You can even use the
existing logging framework's log-level-checks if you want, like this:

PrintWriter out = null;

try {

  if(logger.isDebugEnabled())
     = new PrintWriter(FileWriter("/logs/job-" + jobId));

  ...

  if(null != out)
    out.println("Got an interesting value: " + interestingValue);

  ...
} finally {
  if(null != out)
    try { out.close(); }
    catch (IOException ioe) {
      logger.error("Couldn't close job log", ioe);
    }
}

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/iTTkACgkQ9CaO5/Lv0PDW2gCfRuyYHaUZ8hNbmeKSw/wBmdsD
XuIAnRG0NjBmPrsNT8RCDFuvZIbzYIGH
=k33J
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to