Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有不止一个程序要写入日志文件。每个程序都需要写入单独的日志文件。我这样做是为了根据程序的进程区分日志条目。我想配置一个文件并将其用于日志记录,而不是使用 FileHandler 类。有人可以帮我举个例子吗?
您是否正在寻找这样的东西:
$ java -Djava.util.logging.config.file=/path/to/app.properties MainClass
这是您可以设置日志记录配置文件的命令行。