general library

MVC frameworks

spark: microframework ispirato a Sinatra:

REST libs

Utils

  • JRebel: live reload of the java server

log4j

ensure log4j.jar is in class path

private static org.apache.log4j.Logger logger = Logger.getLogger( this.getClass().getName()
);

config: workspace/projectdirectory/bin/log4j.properties

log4j.rootLogger=debug, stdout
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=%t %-5p %c{2} - %m%n

log4j conf file to specify a configuration file

  • name exactly "log4j.properties" in your classpath
  • add a System property to command line
-Dlog4j.configuration=$conf_dir/log4j.properties

basic config in code

String logConfPath = System.getProperty("log4j.configuration");
if( logConfPath == null || logConfPath.isEmpty() ) {
    // se non è settato log4j.configuration
    // Set up a simple configuration that logs on the console.
    BasicConfigurator.configure();
}
this.logger.debug("logger init");

Notice: Undefined variable: browserName in /var/www/taziomirandola.it/lib/Visitors.php on line 86

Notice: Undefined variable: browserName in /var/www/taziomirandola.it/lib/Visitors.php on line 96

Deprecated: strripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in /var/www/taziomirandola.it/lib/Visitors.php on line 96

Notice: Undefined index: HTTP_ACCEPT_LANGUAGE in /var/www/taziomirandola.it/lib/Visitors.php on line 39

Fatal error: Uncaught TypeError: Argument 1 passed to safe_text() must be of the type string, null given, called in /var/www/taziomirandola.it/lib/Visitors.php on line 39 and defined in /var/www/taziomirandola.it/lib/Visitors.php:162 Stack trace: #0 /var/www/taziomirandola.it/lib/Visitors.php(39): safe_text() #1 /var/www/taziomirandola.it/lib/Visitors.php(124): Visitors::getData() #2 [internal function]: Visitors::log() #3 {main} thrown in /var/www/taziomirandola.it/lib/Visitors.php on line 162