Commit 1cfd70ab by Yonathan Carvajal

cambio en la forma de crear los logs

parent 314103e2
export ENV=development
export HOST_TRUSTED=url_trustedx
export PUERTO=38080 o 38081
......@@ -7,21 +7,18 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.http.HttpEntity;
import org.springframework.web.client.RestTemplate;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import co.com.certicamara.dto.EntidadSolicitudDto;
import co.com.certicamara.utils.UtilsXML;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLSession;
@Service
public class SoapClienteServicio {
private final Logger logger = Logger.getLogger(this.getClass());
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Value("${HOST_TRUSTED}")
private String host;
......
package co.com.certicamara.servicio;
import org.apache.log4j.Logger;
import org.apache.tomcat.util.codec.binary.Base64;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
......@@ -17,7 +19,6 @@ import javax.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller;
import java.io.*;
import org.apache.commons.codec.binary.Base64;
import java.io.ByteArrayInputStream;
import java.math.BigInteger;
import java.security.Principal;
......@@ -33,7 +34,7 @@ import java.util.Map;
@Service
public class TrustedServicio {
private final Logger logger = Logger.getLogger(this.getClass());
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private SoapClienteServicio soapClienteServicio;
......
package co.com.certicamara.utils;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
......@@ -14,11 +14,13 @@ import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import java.io.StringWriter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Component
public class UtilsXML {
private final Logger logger = Logger.getLogger(this.getClass());
private final Logger logger = LoggerFactory.getLogger(this.getClass());
public String generarSoapCertificados(String username, String password, String nuip)
throws ParserConfigurationException {
......
# Root logger option
log4j.rootLogger=INFO, stdout, file
# Redirect log messages to console
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
# Redirect log messages to a log file, support file rolling.
log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
log4j.appender.file.DatePattern='.'yyyy-MM-dd
log4j.appender.file.File=../logs/ms_list_certificate.log
>>>>>>> logs
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>../logs/Ms-list-certificate.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>../logs/Ms-list-certificate-%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<maxFileSize>10MB</maxFileSize> <!-- Tamaño máximo del archivo antes de rotar -->
<!-- <maxHistory>10</maxHistory> Número máximo de archivos de registro a mantener -->
<!-- <totalSizeCap>1GB</totalSizeCap> Tamaño total máximo de todos los archivos de registro -->
</rollingPolicy>
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<root level="info">
<appender-ref ref="console"/>
<appender-ref ref="file"/>
</root>
</configuration>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment