Import into your pom.xml the following xml part. <dependencies> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-api</artifactId> <version>2.9.1</version> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> <version>2.9.1</version> </dependency> </dependencies> create the configuration file configuration.xml <?xml version=”1.0″ encoding=”UTF-8″?> <Configuration> <Appenders> <Console name=”Console”> <PatternLayout pattern=”%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} – %msg%n”/> </Console> </Appenders> <Loggers> <Root level=”trace”> <AppenderRef ref=”Console”/> </Root> </Loggers> </Configuration> use it import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; class … Read More “LOG4J 2: QUICKSTART AND CONCEPTS” »
Remarks of using the Udemy as the host for the course
docker pull mysql #lista of the images downloadeds doker images #must run the docker instance and download the image #-e enviroment variables #-d set to run as a Deamon docker run –name database -e MYSQL_ROOT_PASSWORD=teste123 -d mysql #all docker containers at executing state # -a show all even the ones not ate executing state docker … Read More “CONTAINER: DOCKER – BASIC COMANDS” »
# jpa 2.1 # This anotation allows you to change the behavior of a Lazy entity loading default, in the case the var is the atribute that # will behave like EAGUER when using a query with TypedQuery.setHint(“javax.persistence.loadgraph”, eg); # #theAtributeName: … import javax.persistence.NamedAttributeNode; import javax.persistence.NamedEntityGraph; … @NamedEntityGraph(name=”aNameToCallIt”,attributeNodes={@NamedAttributeNode(“theAtributeName”)}) @Entity @Table(name = “nameoftheTable”) public class ClassName … Read More “JPA: @namedEntityGraph” »
javax.mail javax.mail-api 1.5.6 class Mailer{ Properties props = new Properties(); public Mailer(){ props.put(“mail.smtp.host”, “smtp.gmail.com”); props.put(“mail.smtp.socketFactory.port”, “465”); props.put(“mail.smtp.socketFactory.class”, “javax.net.ssl.SSLSocketFactory”); props.put(“mail.smtp.auth”, “true”); props.put(“mail.smtp.port”, “465”); } public static void send(final String from,final String password,String to,String sub,String msg){ //get Session Session session = Session.getDefaultInstance(props, new javax.mail.Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(from,password); } }); //compose message try … Read More “JAVA: MAIL” »
//** * Function that recieves a array and the rule to filter the itens on it * One sample: * function reduceToArray([],item=>item.id==1); * * Rule is to be a function that will have a item of the array as the parameter and his result is a boolean * like this for example: * function rule(item){ … Read More “JAVASCRIPT: ARRAYS – REDUCING TO AN ARRAY” »