All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.zodiac.sdk.log.global.Slite2LogPathInit Maven / Gradle / Ivy

The newest version!
package org.zodiac.sdk.log.global;

import org.zodiac.sdk.log.constants.LogConstants;
import org.zodiac.sdk.log.util.ReportUtil;

public class Slite2LogPathInit {

    /***
     * 

在平台starter 的 ApplicationContextInitializer 要调用此函数做判断达到设置日志路径的目的:

*
*
    *
  1. 是否设置了全局路径参数logging.path
  2. *
  3. 没有设置将设置路径platformLoggingPath
  4. *
*
* * @param platformLoggingPath 中间件日志路径参数 */ public static void initLoggingPath(String platformLoggingPath) { if (isBlank((String) System.getProperties().get(LogConstants.LOG_PATH)) && !isBlank(platformLoggingPath)) { System.getProperties().put(LogConstants.LOG_PATH, platformLoggingPath); ReportUtil.reportDebug("Actual " + LogConstants.LOG_PATH + " is [ " + platformLoggingPath + " ]"); } } private static boolean isBlank(String str) { int strLen; if (str == null || (strLen = str.length()) == 0) { return true; } for (int i = 0; i < strLen; i++) { if (!Character.isWhitespace(str.charAt(i))) { return false; } } return true; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy