查找日志信息

Java日志信息最容易查找。它们的日志信息中通常有类名与行号生成:

111770[PaymentGatewayServices.java:776:INFO ] (Capture) Invoice [#10110] total: 38.54

Minilang方法日志中的类名均为Log.java,如:

112499[ Log.java:103:INFO ] Finished quickShipEntireOrder:\nshipmentShipGroupFacilityList=[[shipmentId=10120, facilityId=WebStoreWarehouse, shipGroupSeqId=00001]]\nsuccessMessageList=[Created shipment with ID [10120] for ship group ID [00001] for facility ID [WebStoreWarehouse]]

如果你在 beanshell中直接使用输出,你输出的内容将显著的显示于日志文件中:

2006-07-19 13:46:26,373 [ ServiceDispatcher.java:450:DEBUG] [[Sync service finished- total:0.027,since last(Begin):0.027]] - ‘ecommerce / getProductCategoryAndLimitedMembers’

parentCategory = TABLE-LINENS-SOLIDS

2006-07-19 13:46:26,874 [ PriceServices.java:802:INFO ] PromoPrice and ProductPriceAction had null amount and no default price was available, using list price: 2.0 for product with id 15899

如果你在 beanshell中使用调试方法,你将在日志中得到如下信息:

2006-07-19 13:46:26,373 [ ?:?] parentCategory = TABLE-LINENS-SOLIDS

你可以为那些无法发现日志信息的minilang或beanshell代码中加入自己的信息输出。

所有 freemarker,screen-widget或form widget输出的信息将直接显示在你的浏览器屏幕上。除非这些控件崩溃否则不会显示任何日志信息。

REF
http://www.javaeye.com/topic/588902