SP logs locations

All other Source.Python topics and issues.
8guawong
Senior Member
Posts: 148
Joined: Sat Sep 20, 2014 3:06 am

SP logs locations

Postby 8guawong » Mon Sep 29, 2014 1:47 pm

in core_settings.ini

Code: Select all

# Set to the areas to log (console, main log, sp log, script log):
#   Console    = 1
#   Main log   = 2
#   SP log     = 4
#   Script log = 8



where is main log? SP log and Script log??

main log location logs/source-python?
or
SP log logs/source-python?
Script log is where the plugins is? ie. addons/source-python/plugins/test
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Mon Sep 29, 2014 2:03 pm

The main log is the actual server log that is created when you use the "log on" command. That file can be found in the ../logs/ directory. The SP log is created in the ../logs/source-python/ directory and is used by SP's API to log specific messages. The script's log is in the ../logs/source-python/ directory under what path you pass your script's specific LogManager instance.
Image
8guawong
Senior Member
Posts: 148
Joined: Sat Sep 20, 2014 3:06 am

Postby 8guawong » Mon Sep 29, 2014 4:15 pm

ah ok but why make it so complicated? isn't it simpler to log it all into one place.. like sourcemod? or we just like having choices :)

areas = 5 is probably what i want then :)
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Mon Sep 29, 2014 7:30 pm

It isn't really complicated. We designed it that way for convenience, as different server operators will want the logs to be in different places.
Image
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Wed Oct 01, 2014 3:42 pm

Sorry for not going into more detail in my previous post. I haven't been on a computer in a few days and didn't feel like typing it all out on my phone.

The "script" one does not apply to the main SP Logger. That was left in there, for the time being, as an example for when a script wants to create their own LogManager instance. The main SP Logger will only log to the console, main server log, and its specific log file. The SP specific log file is created using the following format:
../logs/source-python/source-python.%m-%d-%Y.txt

%m is the 2 digit number representing the month. %d is the 2 digit number representing the day of the month. %Y is the 4 digit year. The date used is the date the file was created on. If you restart your server multiple times in 1 day, it will create the log file once and append items to it if it is already created.


There are planned changes to the LogManager class, as well as adding a new class that allows for package specific logging levels (which might just be implemented in LogManager instead of creating a new class).


5 is typically the value I use, as it keeps SP logs separate from the main log and it also shows in the console. If I rented a server, I would probably use 4 or 6 instead.
Image
8guawong
Senior Member
Posts: 148
Joined: Sat Sep 20, 2014 3:06 am

Postby 8guawong » Wed Oct 01, 2014 4:17 pm

satoon101 wrote:Sorry for not going into more detail in my previous post. I haven't been on a computer in a few days and didn't feel like typing it all out on my phone.

The "script" one does not apply to the main SP Logger. That was left in there, for the time being, as an example for when a script wants to create their own LogManager instance. The main SP Logger will only log to the console, main server log, and its specific log file. The SP specific log file is created using the following format:
../logs/source-python/source-python.%m-%d-%Y.txt

%m is the 2 digit number representing the month. %d is the 2 digit number representing the day of the month. %Y is the 4 digit year. The date used is the date the file was created on. If you restart your server multiple times in 1 day, it will create the log file once and append items to it if it is already created.


There are planned changes to the LogManager class, as well as adding a new class that allows for package specific logging levels (which might just be implemented in LogManager instead of creating a new class).


5 is typically the value I use, as it keeps SP logs separate from the main log and it also shows in the console. If I rented a server, I would probably use 4 or 6 instead.


yea not renting a server so 5 is what i use... but is it possible for next version of SP to change the log to be more informative??

for example of the error message

Code: Select all

10-01-2014 02:05:30 - sp   -   WARNING
   Unable to add attribute "give_named_item"of type "functions" to entity type "player" due to the following:
   Pointer is NULL.


but it doesn't show where this error is coming from , ie. what script

thanks!
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Postby L'In20Cible » Wed Oct 01, 2014 5:16 pm

This warning is not from a script/plugin but from SP itself. It tells you the signature for that function is outdated since the pointer is NULL.
8guawong
Senior Member
Posts: 148
Joined: Sat Sep 20, 2014 3:06 am

Postby 8guawong » Wed Oct 01, 2014 5:20 pm

L'In20Cible wrote:This warning is not from a script/plugin but from SP itself. It tells you the signature for that function is outdated since the pointer is NULL.


ok yea i see other warning messaged now

so how bout keep the most recent warning message on the TOP of the file instead of the bottom? so we don't have to scroll all the way down? :cool:
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Wed Oct 01, 2014 5:20 pm

Well, that is a warning, not an error. That just means that a signature is not found by the API that registers dynamic functions for entities. It is really just an indication that the SP data needs updating, and has nothing to do with any script.
Image
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Thu Oct 02, 2014 3:12 am

Sorry, didn't see your's or L'In20Cible's replies prior to mine above when I posted it.

8guawong wrote:so how bout keep the most recent warning message on the TOP of the file instead of the bottom? so we don't have to scroll all the way down? :cool:
Logging doesn't work that way. Logging appends the current message to the end of the file. All 3 functionalities do this. engine_server.log_print appends the message to the end of the main log file. echo_console prints the message to the server console, at the end. Python's built-in logging package, which we utilize for the SP Logger file, appends the message to the end of the file. There are no plans whatsoever to change this.
Image
8guawong
Senior Member
Posts: 148
Joined: Sat Sep 20, 2014 3:06 am

Postby 8guawong » Thu Oct 02, 2014 8:06 am

satoon101 wrote:Sorry, didn't see your's or L'In20Cible's replies prior to mine above when I posted it.

8guawong wrote:so how bout keep the most recent warning message on the TOP of the file instead of the bottom? so we don't have to scroll all the way down? :cool:
Logging doesn't work that way. Logging appends the current message to the end of the file. All 3 functionalities do this. engine_server.log_print appends the message to the end of the main log file. echo_console prints the message to the server console, at the end. Python's built-in logging package, which we utilize for the SP Logger file, appends the message to the end of the file. There are no plans whatsoever to change this.


ok just a suggestion but no biggie :cool:

Return to “General Discussion”

Who is online

Users browsing this forum: Majestic-12 [Bot] and 63 guests