zhyiwww
          用平實的筆,記錄編程路上的點點滴滴………
          posts - 536,comments - 394,trackbacks - 0
          在調試mapfile的時候,往往不知道怎么才能看到mapserver的執行細節,所以,能查看日至不失為一個好的辦法。
          在mapserver中使用日志的方法如下:

          (1)在MAP中添加輸出日至文件

          CONFIG "MS_ERRORFILE" "/tmp/map_error.log"

          (2)在LAYER里面打開DEBUG
          也就是設置DEBUG的級別。

          DEBUG 5
          根據mapserver的參考文檔,可以設置ON|OFF|0|1|2|3|4|5.
          調試階段,設置成5,可以得到最多的輸出信息。

          (3)實時查看日志
          tail -f /tmp/map_error.log


          (4)錯誤調試
          比如,我添加一個錯誤的標簽AAAA,系統輸出日志如下:
          [Wed Sep  2 16:59:58 2009].311416 msPOSTGISLayerClose -- layerinfo is  NULL
          [Wed Sep  2 17:12:25 2009].871161 loadLayer(): Unknown identifier. Parsing error near (AAAA):(line 149)
          [Wed Sep  2 17:12:25 2009].888432 loadLayer(): Unknown identifier. Parsing error near (AAAA):(line 149)
          [Wed Sep  2 17:12:25 2009].902453 loadLayer(): Unknown identifier. Parsing error near (AAAA):(line 149)
          [Wed Sep  2 17:12:25 2009].907025 loadLayer(): Unknown identifier. Parsing error near (AAAA):(line 149)
          [Wed Sep  2 17:12:25 2009].942961 loadLayer(): Unknown identifier. Parsing error near (AAAA):(line 149)
          [Wed Sep  2 17:12:25 2009].972666 loadLayer(): Unknown identifier. Parsing error near (AAAA):(line 149)
          [Wed Sep  2 17:12:25 2009].977157 loadLayer(): Unknown identifier. Parsing error near (AAAA):(line 149)
          [Wed Sep  2 17:12:25 2009].998068 loadLayer(): Unknown identifier. Parsing error near (AAAA):(line 149)
          [Wed Sep  2 17:12:25 2009].998070 loadLayer(): Unknown identifier. Parsing error near (AAAA):(line 149)
          [Wed Sep  2 17:12:26 2009].19756 loadLayer(): Unknown identifier. Parsing error near (AAAA):(line 149)
          [Wed Sep  2 17:12:26 2009].43084 loadLayer(): Unknown identifier. Parsing error near (AAAA):(line 149)
          [Wed Sep  2 17:12:26 2009].51924 loadLayer(): Unknown identifier. Parsing error near (AAAA):(line 149)
          [Wed Sep  2 17:12:26 2009].68473 loadLayer(): Unknown identifier. Parsing error near (AAAA):(line 149)
          [Wed Sep  2 17:12:26 2009].73118 loadLayer(): Unknown identifier. Parsing error near (AAAA):(line 149)
          [Wed Sep  2 17:12:26 2009].82840 loadLayer(): Unknown identifier. Parsing error near (AAAA):(line 149)
          。。。。。。。。。。。。。

          這樣,你就可以根據錯誤信息很容易的找到錯誤并更正錯誤。




          |----------------------------------------------------------------------------------------|
                                     版權聲明  版權所有 @zhyiwww
                      引用請注明來源 http://www.aygfsteel.com/zhyiwww   
          |----------------------------------------------------------------------------------------|
          posted on 2009-09-02 17:15 zhyiwww 閱讀(916) 評論(0)  編輯  收藏 所屬分類: gis
          主站蜘蛛池模板: 泗阳县| 多伦县| 宝清县| 沾化县| 江门市| 泰和县| 新建县| 荣成市| 九台市| 博爱县| 渭源县| 山阳县| 通化市| 莆田市| 巩义市| 玉树县| 凤山市| 定结县| 鲁甸县| 汝南县| 饶阳县| 青海省| 商南县| 永兴县| 隆林| 分宜县| 宁陕县| 漯河市| 五家渠市| 江油市| 金湖县| 广东省| 望都县| 漠河县| 营山县| 尼木县| 临夏县| 玛沁县| 延长县| 永和县| 常熟市|