Jump to content
  • 0

Chat log not being created


Question

Posted

Hello guys.

 

Im using one of the most recent L2JFrozen revision FYI.

 

I've been recently having the issue of many trash talking players on a server. As i assume everyone gets at some point. And i'm just trying to cut it directly by simple banning everyone that is being disrespectul.

 

The thing is, my chat.log file is not recording. 

 

I've set up on developer.propertier file the part where was LogChat = False to true, and even made an attempt to change directly on the source file.

 

I went to say2.java file (which is the file on this rev that controls all say actions) and found the following line:

 

		if (Config.LOG_CHAT)
		{
			final LogRecord record = new LogRecord(Level.INFO, _text);
			record.setLoggerName("chat");
			
			if (_type == TELL)
			{
				record.setParameters(new Object[]
				{
					CHAT_NAMES[_type],
					"[" + activeChar.getName() + " to " + _target + "]"
				});
			}
			else
			{
				record.setParameters(new Object[]
				{
					CHAT_NAMES[_type],
					"[" + activeChar.getName() + "]"
				});
			}
			
			_logChat.log(record);
		}

Since it's not recognizing the Config.LOG_CHAT, i tried simply to replace it to a simple verification like:

 if (activeChar.getLevel() > 0 )

then keep everything else the same.

 

I even changed the permissions on the log folder for users to have full access to create files, but that wasnt it.

 

And what is even weirder to me, is that GMAudit, karmadrop and some other files are created without any problems.

 

Anyone can help?

11 answers to this question

Recommended Posts

  • 0
Posted

Your log.cfg contains necessary properties for log4j but don't uses in L2J Frozen. You need get him content and put into logger.properties file. This file uses as property definer for log4j.

 

Or rename logger.properties to logger.properties.bak and rename log.cfg to logger.properties. for check my assuming.

 

I think it will work.

  • 0
Posted

Replace this code by path "com.l2jfrozen.logs.ChatFilter.java"

public class ChatFilter implements Filter
{
	@Override
	public boolean isLoggable(final LogRecord record)
	{
		return record.getLoggerName() == "chat";
	}
}

to

public class ChatFilter implements Filter
{
	@Override
	public boolean isLoggable(final LogRecord record)
	{
		return record.getLoggerName().equalsIgnoreCase("chat");
	}
}

 

  • 0
Posted (edited)

@Rootware Hello, thanks for the reply and sorry for only being able to respond today. It's been a busy week for me.

 

I tested the changes you suggested on ChatFilter.java, sadly, that did not solve the problem.

 

Is there any other java file/code regarding chatlog of my revision you'd like to see? I can send it. But i'm still not getting any chat logs.

 

What i find weird as i mentioned earlier, is that GMAudit, Karmadrop, loginserver/gameserver logs get created without any problems. Everything is set to true on developer.properties and i even tested an extra line on Say2.java to register the log for everyone above lv 1 as a way to test but still nothing.

 

Edit:

Here's a list of the log files i get from gameserver:

log/loggerOut.log

log/game/_all.txt

log/game/karma_dieDrop.txt

log/game/New_chars.txt

log/game/RaidBossSpawnManager.txt

log/GMAudit/GM-Name [GM-Id].txt

 

And that's it.

I even tried activating the items log on developer.properties (the one it warns can be too heavy) just so see if it would create the file, but nothing.

 

Thanks in advance for trying to help, by the way.

 

Edited by dextroy
  • 0
Posted

The maximal size of log files is defined in logger.properties. I don't see more difference between GMAudit and ChatLog loggers. Try to replace in this place ChatLogger to GMAudit for checking correct calling the logger feature overall in this place.

  • 0
Posted (edited)
1 hour ago, Rootware said:

The maximal size of log files is defined in logger.properties. I don't see more difference between GMAudit and ChatLog loggers. Try to replace in this place ChatLogger to GMAudit for checking correct calling the logger feature overall in this place.

But where would i attempt that replace? There are multiple files that call for ChatLog on java. On developer properties they already call both. Im trying to understand what you're suggesting me to try.

 

As for logger.properties. I haven't touched here's their codes:

log4j.rootLogger=INFO, console,  file

log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.threshold=DEBUG
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%-5p %m%n

log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.append=true
log4j.appender.file.file=log/loggerOut.log
log4j.appender.file.threshold=INFO
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n

 

 And here's the log.cfg file that's also in the folder:

############################################################
#      Global properties
############################################################

# "handlers" specifies a comma separated list of log Handler 
# classes.  These handlers will be installed during VM startup.
# Note that these classes must be on the system classpath.
# By default we only configure a ConsoleHandler, which will only
# show messages at the INFO and above levels.
#handlers = java.util.logging.ConsoleHandler

# To also add the FileHandler, use the following line instead.
handlers = java.util.logging.FileHandler,java.util.logging.ConsoleHandler,\
           com.l2jfrozen.logs.ErrorLogHandler
chat.handlers = com.l2jfrozen.logs.ChatLogHandler
chat.useParentHandlers = false
gmaudit.handlers = com.l2jfrozen.logs.GMAuditLogHandler
gmaudit.useParentHandlers = false
item.handlers = com.l2jfrozen.logs.ItemLogHandler
item.useParentHandlers = false
audit.handlers = com.l2jfrozen.logs.AuditLogHandler
audit.useParentHandlers = false


# Default global logging level.
# This specifies which kinds of events are logged across
# all loggers.  For any given facility this global level
# can be overriden by a facility specific level
# Note that the ConsoleHandler also has a separate level
# setting to limit messages printed to the console.
.level = CONFIG

############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################

# default file output is in user's home directory.
java.util.logging.FileHandler.pattern = log/java%u.log
java.util.logging.FileHandler.limit = 500000
java.util.logging.FileHandler.count = 5
java.util.logging.FileHandler.formatter = com.l2jfrozen.logs.FileLogFormatter
java.util.logging.FileHandler.level = CONFIG

# Limit the message that are printed on the console to INFO and above.
java.util.logging.ConsoleHandler.level = FINER
java.util.logging.ConsoleHandler.formatter = com.l2jfrozen.logs.ConsoleLogFormatter

# log errors (exceptions)
com.l2jfrozen.logs.ErrorLogHandler.pattern = log/error%u.log
com.l2jfrozen.logs.ErrorLogHandler.count = 5
com.l2jfrozen.logs.ErrorLogHandler.formatter = java.util.logging.SimpleFormatter
com.l2jfrozen.logs.ErrorLogHandler.filter = com.l2jfrozen.logs.ErrorFilter
com.l2jfrozen.logs.ErrorLogHandler.level = CONFIG

# log chats
com.l2jfrozen.logs.ChatLogHandler.pattern = log/chat.log
com.l2jfrozen.logs.ChatLogHandler.formatter = com.l2jfrozen.logs.ChatLogFormatter
com.l2jfrozen.logs.ChatLogHandler.filter = com.l2jfrozen.logs.ChatFilter
com.l2jfrozen.logs.ChatLogHandler.append = true
com.l2jfrozen.logs.ChatLogHandler.level = INFO

# log GM Audit
com.l2jfrozen.logs.GMAuditLogHandler.pattern = log/gmaudit.log
com.l2jfrozen.logs.GMAuditLogHandler.formatter = com.l2jfrozen.logs.GMAuditFormatter
com.l2jfrozen.logs.GMAuditLogHandler.filter = com.l2jfrozen.logs.GMAuditFilter
com.l2jfrozen.logs.GMAuditLogHandler.append = true
com.l2jfrozen.logs.GMAuditLogHandler.level = INFO

# log items
com.l2jfrozen.logs.ItemLogHandler.pattern = log/item.log
com.l2jfrozen.logs.ItemLogHandler.formatter = com.l2jfrozen.logs.ItemLogFormatter
com.l2jfrozen.logs.ItemLogHandler.filter = com.l2jfrozen.logs.ItemFilter
com.l2jfrozen.logs.ItemLogHandler.append = true
com.l2jfrozen.logs.ItemLogHandler.level = INFO

# audit
com.l2jfrozen.logs.AuditLogHandler.pattern = log/audit.log
com.l2jfrozen.logs.AuditLogHandler.formatter = com.l2jfrozen.logs.AuditFormatter
com.l2jfrozen.logs.AuditLogHandler.filter = com.l2jfrozen.logs.AuditFilter
com.l2jfrozen.logs.AuditLogHandler.append = true
com.l2jfrozen.logs.AuditLogHandler.level = INFO


############################################################
# Facility specific properties.
# Provides extra control for each logger.
############################################################

# For example, set the com.xyz.foo logger to only log SEVERE
# messages:
com.l2jfrozen.gameserver.level = CONFIG
com.l2jfrozen.loginserver.level = CONFIG
com.l2jfrozen.gameserver.Connection.level = CONFIG
com.l2jfrozen.gameserver.serverpackets.level = FINER
com.l2jfrozen.gameserver.clientpackets.level = FINER
com.l2jfrozen.gameserver.model.L2Character.level = FINER
com.l2jfrozen.gameserver.skills.SkillsEngine.level = WARNING

# Alt Privileges Administration
AltPrivilegesAdmin.pattern = log/admin-commands.log
AltPrivilegesAdmin.formatter = com.l2jfrozen.logs.FileLogFormatter
AltPrivilegesAdmin.append = true
AltPrivilegesAdmin.level = CONFIG

 

Edit:

Just noticed something else bit weird. The log.cfg file calls for com.l2jfrozen.logs.GMAuditFormatter and com.l2jfrozen.logs.GMAuditFilter

 

However, on com.l2jfrozen.logs there's no GMAudit files, only those:

image.png.5b09d8909ee0c87e751b7f1a6a38be88.png

 

I searched for GMAuditFormatter on the source and couldn't find any other file mentioning that besides the log.cfg. So, i don't know exactly where it's running the code to generate the GMAudit.

Edited by dextroy
  • 0
Posted

I don't seeing reason for no logging chat messages. I posted to you all difference between logger properties. Check the Item logging for correct work by the way, because this one 100% the same but with another file name storing.

  • 0
Posted
2 minutes ago, Rootware said:

I don't seeing reason for no logging chat messages. I posted to you all difference between logger properties. Check the Item logging for correct work by the way, because this one 100% the same but with another file name storing.

I tried, but it did not log item drops aswell. I've been trying to dig all over java codes trying to find something but i couldnt find why one is logging and the other one isn't.

 

Would you know what are all the java files related to creating a specific log so i can compare them? I mean, besides those on com.l2jfrozen.logs?

  • 0
Posted

Try to put into logger.properties file the content from log.cfg with overwritting existing content. Possible, L2J Frozen developers forget change this. At this moment logger.properties don't contains informations about logger handlers. that's possible the main reason of missed files which uses specific logging handlers. E.g. GMAudit uses direct storing into the file all info ignores native logger.

  • 0
Posted
42 minutes ago, Rootware said:

Try to put into logger.properties file the content from log.cfg with overwritting existing content. Possible, L2J Frozen developers forget change this. At this moment logger.properties don't contains informations about logger handlers. that's possible the main reason of missed files which uses specific logging handlers. E.g. GMAudit uses direct storing into the file all info ignores native logger.

Ok but just to understand properly, do i do this with the logger.properties - the notepad file only?

 

Or do i have do look for something on the java codes to implement? If so, what files on the java code should i be looking for? I will test all your suggestions on my next maintenance.

  • 0
Posted
51 minutes ago, Rootware said:

Your log.cfg contains necessary properties for log4j but don't uses in L2J Frozen. You need get him content and put into logger.properties file. This file uses as property definer for log4j.

 

Or rename logger.properties to logger.properties.bak and rename log.cfg to logger.properties. for check my assuming.

 

I think it will work.

Ok thanks!

 

I will attempt that on my next maintenance. I'll be back here tomorrow to say if that has worked for me. Thanks for all the tips so far =)

  • 0
Posted

Ok returning with the results.

 

Switching the files, did not work.

 

However, adding log.cfg lines in addition to those on logger.properties worked like a charm!!

 

Thank you so much for the help and all the tips.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...