Some problems with logger

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
User avatar
u3games
Posts: 1156
Joined: Sun Feb 27, 2011 7:00 pm
Location: Espaรฑa
Contact:

Re: Some problems with logger

Post by u3games »

Yes, work perfet. Thx bro ^^

Any notice about l2j updates in bitbucket???
Image
Sdw
L2j Veteran
L2j Veteran
Posts: 855
Joined: Mon May 03, 2010 8:38 am
Location: France

Re: Some problems with logger

Post by Sdw »

Users who use User Libraries or classpath containers that contain JARs referencing other libraries via Class-Path in the MANIFEST.MF
If you want the referenced JAR files to be included in the classpath, you can do one of the following:

Add the system property (-DresolveReferencedLibrariesForContainers=true) to the -vmargs list on start-up, or
Manually add the referenced JARs to the User Library or to the project.
Sacrifice
Advanced User
Advanced User
Posts: 1026
Joined: Thu Aug 14, 2014 6:31 am

Re: Some problems with logger

Post by Sacrifice »

u3games wrote:Yes, work perfet. Thx bro ^^

Any notice about l2j updates in bitbucket???
You're welcome Mr. :wink:
User avatar
Zoey76
L2j Inner Circle
L2j Inner Circle
Posts: 7005
Joined: Tue Aug 11, 2009 3:36 am

Re: Some problems with logger

Post by Zoey76 »

Sacrifice wrote:
Screenshot_2016-08-04-15-21-41-1.png
Can see red circle... (at the right) on last commit over build section?
This is not implemented yet.
Powered by Eclipse 4.30 ๐ŸŒŒ | Eclipse Temurin 21 โ˜• | MariaDB 11.2.2 ๐Ÿ—ƒ๏ธ | L2J Server 2.6.3.0 - High Five ๐Ÿš€

๐Ÿ”— Join our Discord! ๐ŸŽฎ๐Ÿ’ฌ
User avatar
Zoey76
L2j Inner Circle
L2j Inner Circle
Posts: 7005
Joined: Tue Aug 11, 2009 3:36 am

Re: Some problems with logger

Post by Zoey76 »

Sdw wrote:Zoey didn't test new lib without eclipse it seems :D

Have fun fixing ecj :D
Yes I didn't test directly, I have reverted to 4.4.2, until I can figure out what's wrong.
Powered by Eclipse 4.30 ๐ŸŒŒ | Eclipse Temurin 21 โ˜• | MariaDB 11.2.2 ๐Ÿ—ƒ๏ธ | L2J Server 2.6.3.0 - High Five ๐Ÿš€

๐Ÿ”— Join our Discord! ๐ŸŽฎ๐Ÿ’ฌ
Sdw
L2j Veteran
L2j Veteran
Posts: 855
Joined: Mon May 03, 2010 8:38 am
Location: France

Re: Some problems with logger

Post by Sdw »

Sdw wrote:Users who use User Libraries or classpath containers that contain JARs referencing other libraries via Class-Path in the MANIFEST.MF
If you want the referenced JAR files to be included in the classpath, you can do one of the following:

Add the system property (-DresolveReferencedLibrariesForContainers=true) to the -vmargs list on start-up, or
Manually add the referenced JARs to the User Library or to the project.
Hint, hint
User avatar
Zoey76
L2j Inner Circle
L2j Inner Circle
Posts: 7005
Joined: Tue Aug 11, 2009 3:36 am

Re: Some problems with logger

Post by Zoey76 »

Sdw wrote:
Sdw wrote:Users who use User Libraries or classpath containers that contain JARs referencing other libraries via Class-Path in the MANIFEST.MF
If you want the referenced JAR files to be included in the classpath, you can do one of the following:

Add the system property (-DresolveReferencedLibrariesForContainers=true) to the -vmargs list on start-up, or
Manually add the referenced JARs to the User Library or to the project.
Hint, hint
I didn't saw that post, I'll take a look later, may change the system completely.
Powered by Eclipse 4.30 ๐ŸŒŒ | Eclipse Temurin 21 โ˜• | MariaDB 11.2.2 ๐Ÿ—ƒ๏ธ | L2J Server 2.6.3.0 - High Five ๐Ÿš€

๐Ÿ”— Join our Discord! ๐ŸŽฎ๐Ÿ’ฌ
Sacrifice
Advanced User
Advanced User
Posts: 1026
Joined: Thu Aug 14, 2014 6:31 am

Re: Some problems with logger

Post by Sacrifice »

Sacrifice wrote:Login windon

Code: Select all

java -Xms128m -Xmx256m -cp ./../libs/*;l2jlogin.jar com.l2jserver.loginserver.L2LoginServer
Game windon

Code: Select all

java -Djava.util.logging.manager=com.l2jserver.util.L2LogManager -Dpython.cachedir=../cachedir -Xms1024m -Xmx1536m -cp ./../libs/*;l2jserver.jar com.l2jserver.gameserver.GameServer
Login linux

Code: Select all

#!/bin/bash

err=1
until [ $err == 0 ]; 
do
	[ -f log/java0.log.0 ] && mv log/java0.log.0 "log/`date +%Y-%m-%d_%H-%M-%S`_java.log"
	[ -f log/stdout.log ] && mv log/stdout.log "log/`date +%Y-%m-%d_%H-%M-%S`_stdout.log"
	java -Xms128m -Xmx256m -cp ./../libs/*;l2jlogin.jar com.l2jserver.loginserver.L2LoginServer > log/stdout.log 2>&1
	err=$?
	sleep 10;
done
Game Linux

Code: Select all

#!/bin/bash

# exit codes of GameServer:
#  0 normal shutdown
#  2 reboot attempt

while :; do
	[ -f log/java0.log.0 ] && mv log/java0.log.0 "log/`date +%Y-%m-%d_%H-%M-%S`_java.log"
	[ -f log/stdout.log ] && mv log/stdout.log "log/`date +%Y-%m-%d_%H-%M-%S`_stdout.log"
	java -Djava.util.logging.manager=com.l2jserver.util.L2LogManager -Dpython.cachedir=../cachedir -Xms1024m -Xmx1536m -cp ./../libs/*;l2jserver.jar com.l2jserver.gameserver.GameServer > log/stdout.log 2>&1
	[ $? -ne 2 ] && break
#	/etc/init.d/mysql restart
	sleep 10
done
@Zoey76, this solve the issue with ecj versions forward and backward. Try please.

There is no reason to break us the coconut :lol: :lol:
Sacrifice
Advanced User
Advanced User
Posts: 1026
Joined: Thu Aug 14, 2014 6:31 am

Re: Some problems with logger

Post by Sacrifice »

This fixes issues with ecj-4.5.1.jar library and fixes also my mistake in previous posts.
100% tested and working on both Operating systems (LINUX and WINDOWS) with the library ecj-4.5.1.jar
SPOILER:
build.gradle file (L2J_Server project)

Code: Select all

apply plugin: 'java'
apply plugin: 'distribution'
apply plugin: 'eclipse'

defaultTasks('clean', 'build')

sourceCompatibility = JavaVersion.VERSION_1_8

repositories {
    mavenCentral()
}

configurations.all {
    transitive = false
}

dependencies {
	compile 'com.mchange:c3p0:0.9.5.2'
	compile 'com.jolbox:bonecp:0.8.0.RELEASE'
	compile 'com.sun.mail:javax.mail:1.5.5'
	compile 'com.zaxxer:HikariCP:2.4.7'
	compile 'mysql:mysql-connector-java:6.0.3'
	compile 'org.bitlet:weupnp:0.1.4'
	compile 'org.eclipse.jdt.core.compiler:ecj:4.5.1'
	compile 'com.google.guava:guava:19.0'
	compile 'org.python:jython:2.2.1'
	compile 'org.slf4j:slf4j-api:1.7.21'
	compile 'org.slf4j:slf4j-jdk14:1.7.21'
	compile fileTree(dir: 'dist/libs', include: '*.jar')
	testCompile 'org.testng:testng:6.9.10'
	testCompile 'org.mockito:mockito-all:2.0.2-beta'
	testCompile 'com.beust:jcommander:1.48'
}

def generalManifest = manifest {
	attributes('Built-By': System.getProperty('user.name'),
			'Built-Date': new Date().format("yyyy-MM-dd HH:mm:ss"),
			'Implementation-URL': 'http://www.l2jserver.com/',
			'Class-Path': configurations.runtime.collect({ '../libs/' + it.getName() }).join(' '))
}

jar {
	archiveName = 'l2jserver.jar'
	exclude('**/dbinstaller/**')
	exclude('**/loginserver/**')
	exclude('**/accountmanager/**')
	exclude('**/gsregistering/**')
	manifest {
		from(generalManifest)
		attributes ('Main-Class': 'com.l2jserver.gameserver.GameServer')
	}
}

task loginJar(type: Jar, dependsOn: classes) {
	from(sourceSets.main.output)
	archiveName = 'l2jlogin.jar'
	exclude('**/dbinstaller/**')
	exclude('**/gameserver/**')
	manifest {
		from(generalManifest)
		attributes('Main-Class': 'com.l2jserver.loginserver.L2LoginServer')
	}
}

task configuratorJar(type: Jar, dependsOn: classes) {
	from(sourceSets.main.output)
	archiveName = 'L2J_Configurator.jar'
	include('**/configurator/**')
	include('**/i18n/**')
	include('**/images/**')
	exclude('**/accountmanager/**')
	exclude('**/dbinstaller/**')
	exclude('**/gameserver/**')
	exclude('**/gsregistering/**')
	exclude('**/log/**')
	exclude('**/loginserver/**')
	exclude('**/status/**')
	exclude('**/util/**')
	exclude('**/Config/**')
	exclude('**/ConnectionFactory/**')
	exclude('**/Server/**')
	manifest {
		from(generalManifest)
		attributes('Main-Class': 'com.l2jserver.tools.configurator.ConfigUserInterface')
	}
}

task dbInstLsJar(type: Jar, dependsOn: classes) {
	from(sourceSets.main.output)
	archiveName = 'dbinst_ls.jar'
	include '**/dbinstaller/**'
	include '**/images/**'
	include '**/util/**'
	include '**/SQLFilter**'
	exclude '**/LauncherGS*'
	manifest {
		from(generalManifest)
		attributes('Main-Class': 'com.l2jserver.tools.dbinstaller.LauncherLS')
	}
}

task dbInstGsJar(type: Jar, dependsOn: classes) {
	from(sourceSets.main.output)
	archiveName = 'dbinst_gs.jar'
	include('**/dbinstaller/**')
	include('**/images/**')
	include('**/util/**')
	include('**/SQLFilter**')
	exclude('**/LauncherLS*')
	manifest {
		from(generalManifest)
		attributes 'Main-Class': 'com.l2jserver.tools.dbinstaller.LauncherGS'
	}
}

artifacts {
	archives loginJar, configuratorJar, dbInstLsJar, dbInstGsJar
}

task zip(type: Zip, dependsOn: build) {
	from('dist') {
		exclude('libs')
	}
	into('libs') {
		from(configurations.runtime)
	}
	into('game') {
		from(jar)
		from(configuratorJar)
	}
	into('login') {
		from(loginJar)
	}
	into('tools') {
		from(dbInstLsJar)
		from(dbInstGsJar)
	}
	
	def fileName = 'L2J_Server_' + new Date().format("yyyy-MM-dd")
	baseName = fileName
	println 'Build in build/distributions/' + fileName + '.zip'
}

build.finalizedBy(zip)

task wrapper(type: Wrapper) {
	gradleVersion = '3.0'
}

eclipse {
	project {
		comment 'L2J Server Project'
		natures 'org.eclipse.buildship.core.gradleprojectbuilde'
	}
	jdt {
		file {
			whenMerged {jdt ->
				def propertiesField = org.gradle.plugins.ide.internal.generator.PropertiesPersistableConfigurationObject.getDeclaredField('properties')
				propertiesField.accessible = true
				Properties properties = propertiesField.get(jdt)
				properties.setProperty 'org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch', 'ignore'
			}
		}
	}
}
GameServer_loop.sh file

Code: Select all

#!/bin/bash

# exit codes of GameServer:
#  0 normal shutdown
#  2 reboot attempt

while :; do
	[ -f log/java0.log.0 ] && mv log/java0.log.0 "log/`date +%Y-%m-%d_%H-%M-%S`_java.log"
	[ -f log/stdout.log ] && mv log/stdout.log "log/`date +%Y-%m-%d_%H-%M-%S`_stdout.log"
	java -Djava.util.logging.manager=com.l2jserver.util.L2LogManager -Dpython.cachedir=../cachedir -Xms1024m -Xmx1536m -cp ./../libs/*:l2jserver.jar com.l2jserver.gameserver.GameServer > log/stdout.log 2>&1
	[ $? -ne 2 ] && break
#	/etc/init.d/mysql restart
	sleep 10
done
startGameServer.bat file

Code: Select all

@echo off
title Game Server Console

:start
echo Starting L2J Game Server.
echo.

java -Djava.util.logging.manager=com.l2jserver.util.L2LogManager -Dpython.cachedir=../cachedir -Xms1024m -Xmx1536m -cp ./../libs/*;l2jserver.jar com.l2jserver.gameserver.GameServer

REM NOTE: If you have a powerful machine, you could modify/add some extra parameters for performance, like:
REM -Xms1536m
REM -Xmx3072m
REM -XX:+AggressiveOpts
REM Use this parameters carefully, some of them could cause abnormal behavior, deadlocks, etc.
REM More info here: http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html

if ERRORLEVEL 2 goto restart
if ERRORLEVEL 1 goto error
goto end

:restart
echo.
echo Admin Restarted Game Server.
echo.
goto start

:error
echo.
echo Game Server Terminated Abnormally!
echo.

:end
echo.
echo Game Server Terminated.
echo.
pause
LoginServer_loop.sh file

Code: Select all

#!/bin/bash

err=1
until [ $err == 0 ];
do
	[ -f log/java0.log.0 ] && mv log/java0.log.0 "log/`date +%Y-%m-%d_%H-%M-%S`_java.log"
	[ -f log/stdout.log ] && mv log/stdout.log "log/`date +%Y-%m-%d_%H-%M-%S`_stdout.log"
	java -Xms128m -Xmx256m -cp ./../libs/*:l2jlogin.jar com.l2jserver.loginserver.L2LoginServer > log/stdout.log 2>&1
	err=$?
	sleep 10;
done
startLoginServer.bat file

Code: Select all

@echo off
title Login Server Console

:start
echo Starting L2J Login Server.
echo.

java -Xms128m -Xmx256m -cp ./../libs/*;l2jlogin.jar com.l2jserver.loginserver.L2LoginServer

if ERRORLEVEL 2 goto restart
if ERRORLEVEL 1 goto error
goto end

:restart
echo.
echo Admin Restarted Login Server.
echo.
goto start

:error
echo.
echo Login Server terminated abnormally!
echo.

:end
echo.
echo Login Server Terminated.
echo.
pause
Good Luck :clap: :+1:
Post Reply