Search code examples
tridiontridion-2011tridion-content-delivery

How to enable Content Delivery Loggin


How to enable content delivery logging in Tridion 2011 sp1. We have .net version of content delivery. After installation of content delivery we changed logback file present in our application folder (D:\Inetpub\MyPortal\bin\config), below is the setting in logback xml

<property name="log.history" value="7"/>
<property name="log.folder" value="D:\tridion\log"/>
<property name="log.level" value="DEBUG"/>

After doing the change we reset the IIS. But we don't see any log file at above location.

Reason why we want to check log file is.

We have implemented content filter mechanism. In which we are using various Query Criteria like ItemSchemaCriteria, CustomMetaKeyCriteria, KeywordCriteria.

Somehow for some filters results are not displayed, though we have component present in broker database. How to check exactly what query is getting fired when filter mechanism is executed on page.

Note : At location d:\Tridion\log\ We can see files like cd_core.2012-10-25,cd_monitor.2012-10-25, cd_deployer.2012-10-25,cd_transport.2012-10-25 but these files are old we need today's log. (04-11-2012)

More inputs on issue : We found that when we add cirteria for Category that time results are not coming.

KeywordCriteria FilterCategory5303Criteria0= new KeywordCriteria("FilterCategory","Administrative"); Criteria[] filterCatCriteria5303 = {FilterCategory5303Criteria0}; Criteria filterCatOrCriteria5303 = CriteriaFactory.Or(filterCatCriteria5303); mainCriteria5303 =CriteriaFactory.And(mainCriteria5303, filterCatOrCriteria5303);

In CUSTOM_META table in broker db we have entry for 2 component. KEY_NAME = "FilterCategory" and KEY_STRING_VALUE="Administrative"


Solution

  • Whenever a Broker Query doesn't give me the results I expect, I head towards the MSSQL Query Profiler to see what actually happens on the database level.

    I documented this process in an article on the Tridion practice wiki: http://code.google.com/p/tridion-practice/wiki/TroubleshootBrokerQueryGeneration .

    A quick summary of the steps:

    1. start the MSSQL Query Profiler
    2. start a new Trace
    3. filter the trace on database name
    4. reload your page, so the query fires
    5. find the query in the Profiler
    6. copy the query into a better tool and reformat it

    Once you reach step 6, it is often somewhat clear why there are no results. I often end up then modifying the SQL to give the results that I'm looking for. And from that I modify the Criteria to generate that SQL, which can at times be a challenge.