Admin tool Log Viewer custom file load
Admin tool Log Viewer custom file load
Is it possible to load a custom log file for viewing from the admin tool?
Re: Admin tool Log Viewer custom file load
Hi,
no, it's not possibile.
Cheers
no, it's not possibile.
Cheers
Re: Admin tool Log Viewer custom file load
However, you may want to check this part of the documentation:
http://docs2x.smartfoxserver.com/Gettin ... om-modules
if you're interested in building a custom AdminTool to view your log files.
Cheers
http://docs2x.smartfoxserver.com/Gettin ... om-modules
if you're interested in building a custom AdminTool to view your log files.
Cheers
Re: Admin tool Log Viewer custom file load
thanks, this is very helpful.
Re: Admin tool Log Viewer custom file load
I just started implementing my own gm handler and im running into issue.
once deploying the jar to the __lib__ directory, the server will not boot correctly. it keeps on rebooting indefinitly and i see no error. once i move the jar out of __lib__, server will boot fine and i see this
my handler is basic and barebone.
once deploying the jar to the __lib__ directory, the server will not boot correctly. it keeps on rebooting indefinitly and i see no error. once i move the jar out of __lib__, server will boot fine and i see this
Code: Select all
02 Mar 2023 | 09:37:48,611 | WARN | main | Extensions | | {Admin}: Request handler for Administration Tool's 'GM' custom module can't be loaded due to the previous error; module discarded
02 Mar 2023 | 09:37:48,611 | WARN | main | Extensions | | {Admin}: SVG icon for module 'GM' is not available
my handler is basic and barebone.
Code: Select all
package GM;
import com.smartfoxserver.v2.admin.handlers.requests.BaseAdminModuleReqHandler;
import com.smartfoxserver.v2.annotations.Instantiation;
import com.smartfoxserver.v2.annotations.MultiHandler;
import com.smartfoxserver.v2.entities.User;
import com.smartfoxserver.v2.entities.data.ISFSObject;
import com.smartfoxserver.v2.extensions.SFSExtension;
@MultiHandler
@Instantiation(Instantiation.InstantiationMode.SINGLE_INSTANCE)
public class GameManagerReqHandler extends BaseAdminModuleReqHandler
{
public static final String MODULE_ID = "GameManager";
private static final String COMMANDS_PREFIX = "gameMan";
public GameManagerReqHandler()
{
super(COMMANDS_PREFIX, MODULE_ID);
}
@Override
protected void handleAdminRequest(User sender, ISFSObject params)
{
String cmd = params.getUtfString(SFSExtension.MULTIHANDLER_REQUEST_ID);
trace ("cmd");
}
}
Re: Admin tool Log Viewer custom file load
The logged error mentions a previous error causing the module to be discarded.
Is there another error reported in the logs before that line?
Is there another error reported in the logs before that line?
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
Re: Admin tool Log Viewer custom file load
There is no error, just keep restarting by itself.
Re: Admin tool Log Viewer custom file load
Can you please post the module declaration in your AdminTool.xml file?
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
Re: Admin tool Log Viewer custom file load
<module id="GameManager" name="Game Manager" description="Game management tools" className="GM.GameManagerReqHandler"/>
Re: Admin tool Log Viewer custom file load
We tested your class and setup and everything works as expected.
Make sure your jar file is generated correctly, and it contains the "GM/GameManagerReHandler.class" folder/file.
Make sure your jar file is generated correctly, and it contains the "GM/GameManagerReHandler.class" folder/file.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
Re: Admin tool Log Viewer custom file load
Its valid jar.
Please confirm my setup.
build jar file as whatever.jar and move it to __lib__ dir
add module to admintool.xml
duplicate icon.svg and rename it to the module id.svg
reboot server
Please confirm my setup.
build jar file as whatever.jar and move it to __lib__ dir
add module to admintool.xml
duplicate icon.svg and rename it to the module id.svg
reboot server
Re: Admin tool Log Viewer custom file load
Yes, we tested in version 2.18 too, and it works fine.
You should check if your jar contains the class only, or if it also contains dependancies (which shouldn't).
At this url you can get our test project, which also includes our jar file to be deployed to extensions/__lib__:
http://www.smartfoxserver.com/temp/cust ... e_test.zip
You should check if your jar contains the class only, or if it also contains dependancies (which shouldn't).
At this url you can get our test project, which also includes our jar file to be deployed to extensions/__lib__:
http://www.smartfoxserver.com/temp/cust ... e_test.zip
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
Re: Admin tool Log Viewer custom file load
ok, this is very weird. your version of the jar works.
i copied your java and rebuilt and it fails for me.
the structure of both jars are identical..
im stumped.
i copied your java and rebuilt and it fails for me.
the structure of both jars are identical..
im stumped.
- Attachments
-
- Screen Shot 2023-03-03 at 1.43.16 PM.png
- (169.05 KiB) Not downloaded yet
Re: Admin tool Log Viewer custom file load
Ok, i found the problem. Not sure why it is, but after changing the project's JRE System Library from JavaSE-17 to JavaSE-1.8 fixed the issue.
Re: Admin tool Log Viewer custom file load
You don't have to change the JDK necessarily, you just need to configure the compiler to produce Java 8 compatible bytecode (Java 11 is also fine).
Cheers
Cheers
Who is online
Users browsing this forum: No registered users and 53 guests