2

I'm getting a "Page Not Found" error from DD4T, but I'm not sure why.

How do I enable logging for DD4T? I'm getting the other CD log messages, but I don't see anything for DD4T.

2

Assuming .NET (may apply to Java too).

The route that is configured out of the box catches everything, because of this "Page Not Found" could be caused by the following things:

  1. Missing images
  2. Favicon not present
  3. You're typing the wrong URL (without index.html or similar)

You can use the IgnoreRoute method in your routing config to ignore requests for a particular file or extension but you may want to check the Request.Url property for what is being requested and figure out why it is missing.

To actually answer the question for .NET you can configure the DD4T.LoggerClass Web.config setting with the class to use for logging. I tend to use log4net - you'll need to add a reference to log4net and then add the web.config setting like so:

<add key="DD4T.LoggerClass" value="DD4T.LogWrappers.Log4Net.Log4NetLogger, DD4T.LogWrappers.Log4Net" />

A word of warning: DD4T logs a lot of things and this can impact performance so remember to set your log level appropriately.

More here: http://haacked.com/archive/2008/07/14/make-routing-ignore-requests-for-a-file-extension.aspx

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.