我想使用moskito在我的 grails 2.3.9 应用程序中进行监控。 我已经将 moskito 和 webui 的依赖项添加到 BuildConfig.groovy
compile 'net.anotheria:moskito-core:2.4.2'
compile 'net.anotheria:moskito-aop:2.4.2'
runtime 'net.anotheria:moskito-webui:2.4.2'
runtime 'net.anotheria:moskito-web:2.4.2'
runtime 'net.anotheria:moskito-webui-jersey:2.4.2'
我还使用 @Monitor
注解标记了我想要监控的类。
现在我需要访问 moskito-webui。我需要向 grails 应用程序的 web.xml 添加一个 servlet 过滤器(关于 documentation )。我刚刚使用 grails install-templates
安装了 grails 模板并修改了 web.xml 文件,但我无法访问 moskito 的 webui。
有人知道如何在 grails 中为 moskito webui 创建 urlmapping 或 servlet 过滤器吗?如何正确集成?
最佳答案
如果您升级到 2.5.0,则不需要嵌入式 WebUI,而是可以使用名为 MoSKito Inspect 的独立工具(实际上与 WebUI 相同,名称更好听)。 首先添加
moskito-inspect-remote
到你的依赖项。该 jar 包含一个 Web 片段,该片段在 RMI 端口 9041 上启动本地监听器(端口可以稍后更改)。
第二:下载或构建您自己的 MoSKito Inspect(使用 tomcat7 并放入 http://search.maven.org/remotecontent?filepath=net/anotheria/moskito-inspect-standalone/2.5.0/moskito-inspect-standalone-2.5.0.war 或从 github 源代码构建)。
下载链接为: http://www.moskito.org/download.html
第三:启动您的应用程序和 MoSKito Inspect。输入快速连接本地主机和端口 9401。您现在应该看到带注释的类。
如果您还有其他问题,您还可以使用 moskito 邮件列表:[email protected]
问候
莱昂
关于grails - 如何将 moskito-java (监控工具)集成到 Grails 应用程序中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24120722/