在调试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.blogjava.net/zhyiwww
|----------------------------------------------------------------------------------------|
posted on 2009-09-02 17:15
zhyiwww 阅读(891)
评论(0) 编辑 收藏 所属分类:
gis