为了在小型 Java 桌面应用程序中使用日志记录,我试图深入了解某些方法的操作。我使用一个非常愚蠢的小型 Java 程序来测试它们。
特别是,在测试 LogManager.readConfiguration() 方法的行为时,我发现了一些奇怪的东西。在所有测试中,LogManager 从位于 JRE 目录中 lib/logging.properties 的属性文件中读取其配置。这时候这个文件的内容如下:
handlers=java.util.logging.ConsoleHandler
myapp2.handlers=java.util.logging.ConsoleHandler
myapp2.MyApp2.handlers=java.util.logging.ConsoleHandler
.level=OFF
java.util.logging.ConsoleHandler.level=ALL
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
java.util.logging.SimpleFormatter.format=%4$s: %5$s [%1$tc]%n
myapp2.level=WARNING
myapp2.MyApp2.level=INFO
Run Code Online (Sandbox Code Playgroud)
java程序的代码是:
package myapp2;
import java.io.IOException;
import java.util.logging.LogManager;
import java.util.logging.Logger;
public class MyApp2 {
private static final Logger LOGGER = Logger.getLogger(MyApp2.class.getPackage().getName());
private static final Logger LOGGER1 = Logger.getLogger(MyApp2.class.getName());
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
LOGGER.severe("severe at MyApp2");
LOGGER.warning("warning at MyApp2");
LOGGER.info("info at MyApp2");
LOGGER1.severe("severe1 at MyApp2");
LOGGER1.warning("warning1 at …Run Code Online (Sandbox Code Playgroud) 我将尽可能地描述我的问题.
我事先知道可以使用第一行末尾的反斜杠键入不适合一行的z/OS shell UNIX命令.事实上,我已经在我正在使用的计算机上测试过并且执行得很好.
例如; 为了做测试我输入ls命令如下:
首先没有来自命令行的反斜杠:
ls -la
Run Code Online (Sandbox Code Playgroud)
在从命令行使用反斜杠之后:
ls\
-la
Run Code Online (Sandbox Code Playgroud)
我得到了同样好的结果
我想知道的是如何在使用BPXBATCH执行的STDIN中的z/OS UNIX shell脚本中执行相同操作.
如果我按照以下命令执行ls -la它执行得很好; 但是,如果我尝试将它分成两行,它就不起作用了.
愿任何人在这个问题上有所了解吗?
很多人提前说
(Obvioulsy ls -la是一个非常简单的例子,只是为了表明我面临的问题;真正的命令要大得多)