### 47.2. 以编程方式 你也可以通过调用`SpringApplication.addListeners(…)`方法来激活一个监听器,并传递相应的`Writer`对象。该方法允许你通过`Writer`构造器自定义文件名和路径。