问题描述
我已经使用maven设置了一个独立的灰熊/泽西服务器,并引用以下依赖关系
i have setup a standalone grizzly/jersey server using maven and referencing the following dependencies
<dependency>
<groupId>org.glassfish.grizzly</groupId>
<artifactId>grizzly-http-server</artifactId>
<version>2.3.10</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-grizzly2-http</artifactId>
<version>2.5.1</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<version>2.5.1</version>
</dependency>
我已经使用泽西客户端api实现了一个客户端来获取资源,操作它并将其POST 。一切都很好,到目前为止。
I already implemented a client using the jersey client api to GET a resource, manipulate it and POST it back. Everything fine so far.
现在我想使用卷曲不起作用的东西。但现在的问题是:
Now i wanted to POST something using curl which won't work. But now the question:
事实是,我不能让灰熊登录控制台,还没有找到任何日志文件。 strong>是灰熊使用log4j还是logging-api?任何人都可以提供一个logging.properties或类似的东西?
The thing is that i can't get Grizzly to log something to the console and haven't found any logfiles yet. Is grizzly using log4j or logging-api? Could anyone provide me with a logging.properties or something similar?
我通过eclipse中的运行配置启动服务器
I'm starting the Server through a run config in eclipse specifiy
-Djava.util.logging.config.file=${project_loc}\src\main\resources\logging.properties
作为参数。引用文件存在并包含
as an argument. The references file exists and contains
.handlers= java.util.logging.ConsoleHandler
.level= ALL
java.util.logging.FileHandler.pattern = logs/java%u.log
java.util.logging.FileHandler.limit = 50000
java.util.logging.FileHandler.count = 1
java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter
java.util.logging.ConsoleHandler.level = ALL
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
org.glassfish.level = FINEST
这可能是非常基本的问题,但我厌倦了试错: - )
This might be a very basic question but i'm sick of trial-and-error :-)
推荐答案
Grizzly使用JDK日志API。
不知道为什么它不适用于您,请仔细检查java.util.logging.config.file属性是否正确解决。
Grizzly uses JDK logging API.Not sure why it doesn't work for you, double check that java.util.logging.config.file property is getting properly resolved.
这篇关于灰熊独立日志记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!