dev@grizzly.java.net

Logging message being displayed about favico.ico not found in v3

From: Pramod Gopinath <Pramod.Gopinath_at_Sun.COM>
Date: Thu, 13 Mar 2008 19:52:43 -0700

Hi
  Code diffs for the favico.ico issue that I had run into 2 days back.
Also saw this today on the dev_at_glassfish alias.

Sending in the code diffs that I had used on my setup.

Enjoy
Pramod

Index:
modules/http-utils/src/main/java/com/sun/grizzly/tcp/StaticResourcesAdapter.java
===================================================================
---
modules/http-utils/src/main/java/com/sun/grizzly/tcp/StaticResourcesAdapter.java
(revision 889)
+++
modules/http-utils/src/main/java/com/sun/grizzly/tcp/StaticResourcesAdapter.java
(working copy)
@@ -99,8 +99,16 @@
         }
 
         if (!resource.exists()) {
- logger.log(Level.INFO,"File not found " + resource);
- res.setStatus(404);
+ if (resource.getName().equals("favicon.ico")) {
+ if (logger.isLoggable(Level.FINE)) {
+ logger.log(Level.FINE,"File not found " + resource);
+ }
+ } else {
+ if (logger.isLoggable(Level.INFO)) {
+ logger.log(Level.INFO,"File not found " + resource);
+ }
+ res.setStatus(404);
+ }
             return;
         }
         res.setStatus(200);