Question

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"

Was it helpful?

Solution 2

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.

OTHER TIPS

If you're using:

<property name="log.folder" value="D:\tridion\log"/>

then it's expected that you'll get no logging. Logback expects either double backslashes or simple (fwd)slashes. Example:

<property name="log.folder" value="D:\\tridion\\log"/>

or

<property name="log.folder" value="D:/tridion/log"/>

Further more, if you want to see what (JPQL) query Tridion creates for you from your Broker query then you need to set the logging to TRACE and to search in your logs for the following:

TRACE JPAQueryDAO - Broker Query generated:

This will give you an impression about the final SQL query generated in the end.

My last remark is about the KeywordCriteria and how you're using it. You should know that KeywordCriteria does not relate in any way to the CUSTOM_META table. For queries related to that table you should use the criterias called "CustomMeta***Criteria"

Probably, in your case you need to use:

new CustomMetaValueCriteria(new CustomMetaKeyCriteria("FilterCategory"), "Administrative");

Hope this helps.

Cheers, Daniel.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top