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
          主站蜘蛛池模板: 盱眙县| 崇左市| 安西县| 太和县| 望奎县| 晋州市| 宁德市| 平舆县| 遵义县| 渭源县| 阿荣旗| 方正县| 凤台县| 广丰县| 信宜市| 宁乡县| 墨竹工卡县| 抚顺市| 四子王旗| 南汇区| 秦皇岛市| 邯郸县| 墨竹工卡县| 九寨沟县| 汝阳县| 鞍山市| 靖宇县| 镇雄县| 南陵县| 九龙坡区| 宁安市| 神农架林区| 扎兰屯市| 博罗县| 湘西| 万全县| 壶关县| 普陀区| 南汇区| 金乡县| 宣恩县|