ludc
2023-11-26 c755f7cbcab36626eadabbe2a77666f9e4ddaec7
Source/UBCS/ubcs-ops/ubcs-log/src/main/java/com/vci/ubcs/log/service/impl/LogLocalServiceImpl.java
@@ -16,6 +16,8 @@
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.EnvironmentAware;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -36,7 +38,7 @@
 */
@Service
@Slf4j
public class LogLocalServiceImpl implements ILogLocalService{
public class LogLocalServiceImpl implements ILogLocalService, EnvironmentAware {
   /**
    * 各个服务存放的的父路径
@@ -55,9 +57,13 @@
    */
   private Boolean isWindows = true;
   {
      String os = System.getProperty("os.name").toLowerCase();
      //默认就配置为windows的,如果不是当前系统不是windows就需要对其转换为linux的文件路径格式
   /**
    * 根据当前运行的环境,对配置的日志路径格式进行调整
    * @param environment
    */
   @Override
   public void setEnvironment(Environment environment) {
      String os = environment.getProperty("os.name").toLowerCase();
      if (!os.contains("win")) {
         this.PARENTPATH = this.PARENTPATH.substring(this.PARENTPATH.lastIndexOf(":") + 1).replace("\\", "/");
         this.LOGPATH = this.LOGPATH.replace("\\", "/");