Classic branch.

This commit is contained in:
MobiusDev
2017-05-01 10:49:52 +00:00
parent 304ca84360
commit 23c1374047
19872 changed files with 3745265 additions and 0 deletions

View File

@ -0,0 +1,41 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log;
import java.util.logging.LogManager;
/**
* Specialized {@link LogManager} class.<br>
* Prevents log devices to close before shutdown sequence so the shutdown sequence can make logging.
*/
public class L2LogManager extends LogManager
{
public L2LogManager()
{
}
@Override
public void reset()
{
// do nothing
}
public void doReset()
{
super.reset();
}
}

View File

@ -0,0 +1,32 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.filter;
import java.util.logging.Filter;
import java.util.logging.LogRecord;
/**
* @author zabbix
*/
public class AuditFilter implements Filter
{
@Override
public boolean isLoggable(LogRecord record)
{
return record.getLoggerName().equalsIgnoreCase("audit");
}
}

View File

@ -0,0 +1,29 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.filter;
import java.util.logging.Filter;
import java.util.logging.LogRecord;
public class ChatFilter implements Filter
{
@Override
public boolean isLoggable(LogRecord record)
{
return "chat".equals(record.getLoggerName());
}
}

View File

@ -0,0 +1,29 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.filter;
import java.util.logging.Filter;
import java.util.logging.LogRecord;
public class EnchantItemFilter implements Filter
{
@Override
public boolean isLoggable(LogRecord record)
{
return record.getLoggerName().equalsIgnoreCase("item");
}
}

View File

@ -0,0 +1,29 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.filter;
import java.util.logging.Filter;
import java.util.logging.LogRecord;
public class EnchantSkillFilter implements Filter
{
@Override
public boolean isLoggable(LogRecord record)
{
return record.getLoggerName().equalsIgnoreCase("skill");
}
}

View File

@ -0,0 +1,29 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.filter;
import java.util.logging.Filter;
import java.util.logging.LogRecord;
public class ErrorFilter implements Filter
{
@Override
public boolean isLoggable(LogRecord record)
{
return record.getThrown() != null;
}
}

View File

@ -0,0 +1,29 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.filter;
import java.util.logging.Filter;
import java.util.logging.LogRecord;
public class GMAuditFilter implements Filter
{
@Override
public boolean isLoggable(LogRecord record)
{
return record.getLoggerName().equalsIgnoreCase("gmaudit");
}
}

View File

@ -0,0 +1,56 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.filter;
import java.util.HashSet;
import java.util.Set;
import java.util.logging.Filter;
import java.util.logging.LogRecord;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.model.items.type.EtcItemType;
import com.l2jmobius.gameserver.model.items.type.ItemType;
/**
* @author Advi
*/
public class ItemFilter implements Filter
{
// private String _excludeProcess;
// private String _excludeItemType;
// This is an example how to exclude consuming of shots and arrows from logging
private static final String EXCLUDE_PROCESS = "Consume";
private static final Set<ItemType> EXCLUDED_ITEM_TYPES = new HashSet<>();
static
{
EXCLUDED_ITEM_TYPES.add(EtcItemType.ARROW);
EXCLUDED_ITEM_TYPES.add(EtcItemType.SOULSHOT);
}
@Override
public boolean isLoggable(LogRecord record)
{
if (!"item".equals(record.getLoggerName()))
{
return false;
}
final String[] messageList = record.getMessage().split(":");
return (messageList.length < 2) || !EXCLUDE_PROCESS.contains(messageList[1]) || !EXCLUDED_ITEM_TYPES.contains(((L2ItemInstance) record.getParameters()[0]).getItemType());
}
}

View File

@ -0,0 +1,29 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.filter;
import java.util.logging.Filter;
import java.util.logging.LogRecord;
public class MDamageFilter implements Filter
{
@Override
public boolean isLoggable(LogRecord record)
{
return record.getLoggerName().equalsIgnoreCase("mdam");
}
}

View File

@ -0,0 +1,29 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.filter;
import java.util.logging.Filter;
import java.util.logging.LogRecord;
public class PDamageFilter implements Filter
{
@Override
public boolean isLoggable(LogRecord record)
{
return record.getLoggerName().equalsIgnoreCase("pdam");
}
}

View File

@ -0,0 +1,115 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.formatter;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Formatter;
import java.util.logging.LogRecord;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.StringUtil;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.ConnectionState;
import com.l2jmobius.gameserver.network.L2GameClient;
public class AccountingFormatter extends Formatter
{
private final SimpleDateFormat dateFmt = new SimpleDateFormat("dd MMM H:mm:ss");
@Override
public String format(LogRecord record)
{
final Object[] params = record.getParameters();
final StringBuilder output = StringUtil.startAppend(30 + record.getMessage().length() + (params == null ? 0 : params.length * 10), "[", dateFmt.format(new Date(record.getMillis())), "] ", record.getMessage());
if (params != null)
{
for (Object p : params)
{
if (p == null)
{
continue;
}
StringUtil.append(output, ", ");
if (p instanceof L2GameClient)
{
final L2GameClient client = (L2GameClient) p;
String address = null;
try
{
if (!client.isDetached())
{
address = client.getConnectionAddress().getHostAddress();
}
}
catch (Exception e)
{
}
switch ((ConnectionState) client.getConnectionState())
{
case IN_GAME:
{
if (client.getActiveChar() != null)
{
StringUtil.append(output, client.getActiveChar().getName());
StringUtil.append(output, "(", String.valueOf(client.getActiveChar().getObjectId()), ") ");
}
break;
}
case AUTHENTICATED:
{
if (client.getAccountName() != null)
{
StringUtil.append(output, client.getAccountName(), " ");
}
break;
}
case CONNECTED:
{
if (address != null)
{
StringUtil.append(output, address);
}
break;
}
default:
{
throw new IllegalStateException("Missing state on switch");
}
}
}
else if (p instanceof L2PcInstance)
{
final L2PcInstance player = (L2PcInstance) p;
StringUtil.append(output, player.getName());
StringUtil.append(output, "(", String.valueOf(player.getObjectId()), ")");
}
else
{
StringUtil.append(output, p.toString());
}
}
}
output.append(Config.EOL);
return output.toString();
}
}

View File

@ -0,0 +1,55 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.formatter;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Formatter;
import java.util.logging.LogRecord;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.StringUtil;
/**
* @author zabbix
*/
public class AuditFormatter extends Formatter
{
private final SimpleDateFormat dateFmt = new SimpleDateFormat("dd MMM H:mm:ss");
@Override
public String format(LogRecord record)
{
final Object[] params = record.getParameters();
final StringBuilder output = StringUtil.startAppend(30 + record.getMessage().length() + (params == null ? 0 : params.length * 10), "[", dateFmt.format(new Date(record.getMillis())), "] ", record.getMessage());
if (params != null)
{
for (Object p : params)
{
if (p == null)
{
continue;
}
StringUtil.append(output, ", ", p.toString());
}
}
output.append(Config.EOL);
return output.toString();
}
}

View File

@ -0,0 +1,49 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.formatter;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Formatter;
import java.util.logging.LogRecord;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.StringUtil;
public class ChatLogFormatter extends Formatter
{
private final SimpleDateFormat dateFmt = new SimpleDateFormat("dd MMM H:mm:ss");
@Override
public String format(LogRecord record)
{
final Object[] params = record.getParameters();
final StringBuilder output = StringUtil.startAppend(30 + record.getMessage().length() + (params != null ? 10 * params.length : 0), "[", dateFmt.format(new Date(record.getMillis())), "] ");
if (params != null)
{
for (Object p : params)
{
StringUtil.append(output, String.valueOf(p), " ");
}
}
StringUtil.append(output, record.getMessage(), Config.EOL);
return output.toString();
}
}

View File

@ -0,0 +1,50 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.formatter;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Formatter;
import java.util.logging.LogRecord;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.commons.util.StringUtil;
public class ConsoleLogFormatter extends Formatter
{
private final SimpleDateFormat dateFmt = new SimpleDateFormat("dd/MM HH:mm:ss");
@Override
public String format(LogRecord record)
{
final StringBuilder output = new StringBuilder(500);
StringUtil.append(output, "[", dateFmt.format(new Date(record.getMillis())), "] " + record.getMessage(), Config.EOL);
if (record.getThrown() != null)
{
try
{
StringUtil.append(output, CommonUtil.getStackTrace(record.getThrown()), Config.EOL);
}
catch (Exception ex)
{
}
}
return output.toString();
}
}

View File

@ -0,0 +1,83 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.formatter;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Formatter;
import java.util.logging.LogRecord;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.StringUtil;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Summon;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.skills.Skill;
public class DamageFormatter extends Formatter
{
private final SimpleDateFormat dateFmt = new SimpleDateFormat("yy.MM.dd H:mm:ss");
@Override
public String format(LogRecord record)
{
final Object[] params = record.getParameters();
final StringBuilder output = StringUtil.startAppend(30 + record.getMessage().length() + (params == null ? 0 : params.length * 10), "[", dateFmt.format(new Date(record.getMillis())), "] '---': ", record.getMessage());
if (params != null)
{
for (Object p : params)
{
if (p == null)
{
continue;
}
if (p instanceof L2Character)
{
if ((p instanceof L2Character) && ((L2Character) p).isRaid())
{
StringUtil.append(output, "RaidBoss ");
}
StringUtil.append(output, ((L2Character) p).getName(), "(", String.valueOf(((L2Character) p).getObjectId()), ") ");
StringUtil.append(output, String.valueOf(((L2Character) p).getLevel()), " lvl");
if (p instanceof L2Summon)
{
final L2PcInstance owner = ((L2Summon) p).getOwner();
if (owner != null)
{
StringUtil.append(output, " Owner:", owner.getName(), "(", String.valueOf(owner.getObjectId()), ")");
}
}
}
else if (p instanceof Skill)
{
StringUtil.append(output, " with skill ", ((Skill) p).getName(), "(", String.valueOf(((Skill) p).getId()), ")");
}
else
{
StringUtil.append(output, p.toString());
}
}
}
output.append(Config.EOL);
return output.toString();
}
}

View File

@ -0,0 +1,89 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.formatter;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Formatter;
import java.util.logging.LogRecord;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.StringUtil;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.model.skills.Skill;
public class EnchantFormatter extends Formatter
{
private final SimpleDateFormat dateFmt = new SimpleDateFormat("dd MMM H:mm:ss");
@Override
public String format(LogRecord record)
{
final Object[] params = record.getParameters();
final StringBuilder output = StringUtil.startAppend(30 + record.getMessage().length() + (params == null ? 0 : params.length * 10), "[", dateFmt.format(new Date(record.getMillis())), "] ", record.getMessage());
if (params != null)
{
for (Object p : params)
{
if (p == null)
{
continue;
}
StringUtil.append(output, ", ");
if (p instanceof L2PcInstance)
{
final L2PcInstance player = (L2PcInstance) p;
StringUtil.append(output, "Character:", player.getName(), " [" + player.getObjectId() + "] Account:", player.getAccountName());
if ((player.getClient() != null) && !player.getClient().isDetached())
{
StringUtil.append(output, " IP:", player.getClient().getConnectionAddress().getHostAddress());
}
}
else if (p instanceof L2ItemInstance)
{
final L2ItemInstance item = (L2ItemInstance) p;
if (item.getEnchantLevel() > 0)
{
StringUtil.append(output, "+", String.valueOf(item.getEnchantLevel()), " ");
}
StringUtil.append(output, item.getItem().getName(), "(", String.valueOf(item.getCount()), ")");
StringUtil.append(output, " [", String.valueOf(item.getObjectId()), "]");
}
else if (p instanceof Skill)
{
final Skill skill = (Skill) p;
if (skill.getLevel() > 100)
{
StringUtil.append(output, "+", String.valueOf(skill.getLevel() % 100), " ");
}
StringUtil.append(output, skill.getName(), "(", String.valueOf(skill.getId()), " ", String.valueOf(skill.getLevel()), ")");
}
else
{
StringUtil.append(output, p.toString());
}
}
}
output.append(Config.EOL);
return output.toString();
}
}

View File

@ -0,0 +1,41 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.formatter;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Formatter;
import java.util.logging.LogRecord;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.StringUtil;
/**
* This class ...
* @version $Revision: 1.1.4.1 $ $Date: 2005/03/27 15:30:08 $
*/
public class FileLogFormatter extends Formatter
{
private static final String TAB = "\t";
private final SimpleDateFormat dateFmt = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss,SSS");
@Override
public String format(LogRecord record)
{
return StringUtil.concat(dateFmt.format(new Date(record.getMillis())), TAB, record.getLevel().getName(), TAB, String.valueOf(record.getThreadID()), TAB, record.getLoggerName(), TAB, record.getMessage(), Config.EOL);
}
}

View File

@ -0,0 +1,31 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.formatter;
import java.util.logging.Formatter;
import java.util.logging.LogRecord;
import com.l2jmobius.Config;
public class GMAuditFormatter extends Formatter
{
@Override
public String format(LogRecord record)
{
return record.getMessage() + Config.EOL;
}
}

View File

@ -0,0 +1,70 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.formatter;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Formatter;
import java.util.logging.LogRecord;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.StringUtil;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
/**
* @author Advi
*/
public class ItemLogFormatter extends Formatter
{
private final SimpleDateFormat dateFmt = new SimpleDateFormat("dd MMM H:mm:ss");
@Override
public String format(LogRecord record)
{
final Object[] params = record.getParameters();
final StringBuilder output = StringUtil.startAppend(30 + record.getMessage().length() + (params.length * 50), "[", dateFmt.format(new Date(record.getMillis())), "] ", record.getMessage());
for (Object p : record.getParameters())
{
if (p == null)
{
continue;
}
output.append(", ");
if (p instanceof L2ItemInstance)
{
final L2ItemInstance item = (L2ItemInstance) p;
StringUtil.append(output, "item ", String.valueOf(item.getObjectId()), ":");
if (item.getEnchantLevel() > 0)
{
StringUtil.append(output, "+", String.valueOf(item.getEnchantLevel()), " ");
}
StringUtil.append(output, item.getItem().getName(), "(", String.valueOf(item.getCount()), ")");
}
// else if (p instanceof L2PcInstance)
// output.append(((L2PcInstance)p).getName());
else
{
output.append(p.toString()/* + ":" + ((L2Object)p).getObjectId() */);
}
}
output.append(Config.EOL);
return output.toString();
}
}

View File

@ -0,0 +1,50 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.formatter;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Formatter;
import java.util.logging.LogRecord;
import com.l2jmobius.Config;
import com.l2jmobius.commons.util.StringUtil;
public class OlympiadFormatter extends Formatter
{
private final SimpleDateFormat dateFmt = new SimpleDateFormat("dd/MM/yyyy H:mm:ss");
@Override
public String format(LogRecord record)
{
final Object[] params = record.getParameters();
final StringBuilder output = StringUtil.startAppend(30 + record.getMessage().length() + (params == null ? 0 : params.length * 10), dateFmt.format(new Date(record.getMillis())), ",", record.getMessage());
if (params != null)
{
for (Object p : params)
{
if (p == null)
{
continue;
}
StringUtil.append(output, ",", p.toString());
}
}
output.append(Config.EOL);
return output.toString();
}
}

View File

@ -0,0 +1,28 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.handler;
import java.io.IOException;
import java.util.logging.FileHandler;
public class AccountingLogHandler extends FileHandler
{
public AccountingLogHandler() throws IOException, SecurityException
{
super();
}
}

View File

@ -0,0 +1,28 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.handler;
import java.io.IOException;
import java.util.logging.FileHandler;
public class AllDamageLogHandler extends FileHandler
{
public AllDamageLogHandler() throws IOException, SecurityException
{
super();
}
}

View File

@ -0,0 +1,31 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.handler;
import java.io.IOException;
import java.util.logging.FileHandler;
/**
* @author zabbix
*/
public class AuditLogHandler extends FileHandler
{
public AuditLogHandler() throws IOException, SecurityException
{
super();
}
}

View File

@ -0,0 +1,28 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.handler;
import java.io.IOException;
import java.util.logging.FileHandler;
public class ChatLogHandler extends FileHandler
{
public ChatLogHandler() throws IOException, SecurityException
{
super();
}
}

View File

@ -0,0 +1,28 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.handler;
import java.io.IOException;
import java.util.logging.FileHandler;
public class EnchantItemLogHandler extends FileHandler
{
public EnchantItemLogHandler() throws IOException, SecurityException
{
super();
}
}

View File

@ -0,0 +1,28 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.handler;
import java.io.IOException;
import java.util.logging.FileHandler;
public class EnchantSkillLogHandler extends FileHandler
{
public EnchantSkillLogHandler() throws IOException, SecurityException
{
super();
}
}

View File

@ -0,0 +1,28 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.handler;
import java.io.IOException;
import java.util.logging.FileHandler;
public class ErrorLogHandler extends FileHandler
{
public ErrorLogHandler() throws IOException, SecurityException
{
super();
}
}

View File

@ -0,0 +1,28 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.handler;
import java.io.IOException;
import java.util.logging.FileHandler;
public class GMAuditLogHandler extends FileHandler
{
public GMAuditLogHandler() throws IOException, SecurityException
{
super();
}
}

View File

@ -0,0 +1,31 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.handler;
import java.io.IOException;
import java.util.logging.FileHandler;
/**
* @author Advi
*/
public class ItemLogHandler extends FileHandler
{
public ItemLogHandler() throws IOException, SecurityException
{
super();
}
}

View File

@ -0,0 +1,28 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.handler;
import java.io.IOException;
import java.util.logging.FileHandler;
public class MDamageLogHandler extends FileHandler
{
public MDamageLogHandler() throws IOException, SecurityException
{
super();
}
}

View File

@ -0,0 +1,28 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.handler;
import java.io.IOException;
import java.util.logging.FileHandler;
public class OlympiadLogHandler extends FileHandler
{
public OlympiadLogHandler() throws IOException, SecurityException
{
super();
}
}

View File

@ -0,0 +1,28 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.log.handler;
import java.io.IOException;
import java.util.logging.FileHandler;
public class PDamageLogHandler extends FileHandler
{
public PDamageLogHandler() throws IOException, SecurityException
{
super();
}
}