我应该在web应用程序(maven项目)中将java.util.logging的logging.properties文件放在哪里? [英] Where should I put logging.properties file for java.util.logging in web application (maven project)?

查看:931
本文介绍了我应该在web应用程序(maven项目)中将java.util.logging的logging.properties文件放在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想记录到文件并在属性文件中设置它,因为默认的logger.info()输出进入控制台,在我的情况下在Web应用程序中没有控制台。

I want to logging to file and set it in properties file, because default logger.info() output goes to console and in web application there is no console in my case.

推荐答案

正如Navi所说......它进入 src / main / resources

As Navi says... it goes in src/main/resources

只是为了澄清这个主题...... logging.properties 必须进入 WEB-INF / classes 目录。
如果您使用某种框架来组织项目,您必须找到放置文件的位置,以便留在 WEB-INF / classes
如果您使用maven来组织Web应用程序,您必须知道 src / main / resources 中的所有内容都会转到 WEB- INF / classes。

Just to clarify this subject... the logging.properties must go in WEB-INF/classes directory. If you are using some kind of framework for organizing your project, you must find out where to place the file in order to stay in WEB-INF/classes If you are using maven to organize the web app, you must know that everything that lies in src/main/resources goes to WEB-INF/classes.

这篇关于我应该在web应用程序(maven项目)中将java.util.logging的logging.properties文件放在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆