Real man

in virtual reality

Tag: Java

log4j - xml config

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>

	<!-- declare output to console -->
	<appender name="console" class="org.apache.log4j.ConsoleAppender">
		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n" />
		</layout>
	</appender>

	<!-- declare output to file -->
	<appender name="file" class="org.apache.log4j.RollingFileAppender">
		<param name="append" value="false" />
		<param name="maxFileSize" value="10MB" />
		<param name="maxBackupIndex" value="10" />
		<param name="file" value="${catalina.home}/logs/myStruts1App.log" />
		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n" />
		</layout>
	</appender>

	<!-- set common log level -->
	<root>
		<level value="ERROR" />
		<appender-ref ref="console" />
		<appender-ref ref="file" />
	</root>

	<!-- set log level for custom packages -->
	<logger name="org.iblogger.lbn">
		<level value="DEBUG"/>
	</logger>

</log4j:configuration>

Free programming books

Как следует из названия, куча-мала ссылок на бесплатные книги по программированию. Выбор огромен - от ассемблера до JavaScript, от книг по Windows GUI до Spring.

Судя по history, актуальность ссылок активно поддерживается.

Ссылка на GitHub: https://github.com/vhf/free-programming-books/blob/master/free-programming-books.md

Simplest way to create skeleton: maven + Spring MVC + Hibernate

Run maven:

mvn archetype:generate -DarchetypeGroupId=com.highwise -DarchetypeVersion=0.22 -DarchetypeArtifactId=weby -DgroupId=org.iblogger.lbn -DartifactId=demo -Dversion=1.0-SNAPSHOT -DinteractiveMode=false

(replace text in red with your own values)

You should get the following structure:

demo
├── pom.xml
└── src
    └── main
        ├── java
        │   └── org
        │       └── iblogger
        │           └── lbn
        │               └── demo
        │                   ├── model
        │                   │   ├── Authority.java
        │                   │   ├── Person.java
        │                   │   └── User.java
        │                   ├── service
        │                   │   └── RootUserCreatorService.java
        │                   └── web
        │                       └── PersonController.java
        ├── resources
        │   ├── hibernate.cfg.xml
        │   ├── hsqldb.properties
        │   ├── jdbc.properties
        │   ├── log4j.xml
        │   ├── mysqldb.properties
        │   └── oracle.properties
        └── webapp
            ├── css
            │   └── style.css
            ├── index.jsp
            └── WEB-INF
                ├── demo-servlet.xml
                ├── spring-basic-context.xml
                ├── spring-persistence-context.xml
                ├── spring-security-context.xml
                ├── tags
                │   ├── footer.tag
                │   ├── jquery.tag
                │   ├── menu.tag
                │   └── style.tag
                ├── views
                │   ├── addPerson.jsp
                │   └── allPersons.jsp
                └── web.xml

Now you can import project into Intellij IDEA (as is) or into Eclipse (execute mvn eclipse:eclipse -Dwtpversion=2.0 before importing) and start to edit code for your requirements.

Run project: mvn tomcat:run
URL: http://localhost:8080/demo

Enjoy!

compileonline.com

Compile and Execute your favorite programming languages online.

Programming languages: Ada (Gnat), Algol-68, Assembly, Awk, Bash Shell, Basic, Befunge, Brainf**k, C, C99 Strict, COBOL, C++, C++11, C++0x, C#, Clojure, Dart, D Language, Embedded C, Erlang, F#, Factor, Falcon, Fantom, Forth, Fortran-95, Go, Groovy, Haskell, ICON, Intercal, Java, LISP, Lua, Malbolge, MATLAB/Octave, Mozart-OZ, Nimrod, Node.js, Objective-C, OCaml, PARI/GP, Pascal, Pawn, Perl, PHP, Pike, Prolog, Python, Python-3, REXX, R Programming, Ruby, Rust, Scala, Scheme, Simula, Smalltalk, SQLite SQL, Tcl, Unix Shell, Unlambda, VB.Net, Verilog, Whitespace, LOLCODE, Julia, ScriptBasic, BaCon, ilasm, QuickBasic, SML/NJ.

http://compileonline.com

compileonline.com