Logging prop spawns on server

I am trying to log anything a player spawns. I tried using the “PlayerSpawnedProp” hook, except this only logs props. It won’t log entities or vehicles and some other things.

I then tried using the “OnEntityCreated” hook. This did log stuff, but it logged too much. I wrote the code on the bottom to break it down to only what I wan’t to log.

I’m having 2 problems though. 1, The hook doesn’t seem to get called when a player spawns something from a tool gun. Like an expression 2 chip or a lamp. 2, It will not get the model of the entity. I’m using ent:GetModel() but it always returns nil.

I wan’t to know if there is possibly an easier way to log everything and get it working for everything.

Here is my current code

[lua]
local SEARCH_STRING = {
“prop_”,
“sent_”,
“gmod_”,
“npc_”,
“wac_”
}
function propLogger(plyr, model, entity, dateTime)
local fileName = “prop_spawn_logs.txt”
local log = “”

	log = dateTime .. " " .. "(" .. plyr:SteamID() .. ") \"" .. plyr:Nick() .. "\"" .. ": \"" .. entity:GetClass() .. "\" - \"" .. model .. "\"

"

file.Append(fileName, log)

end

hook.Add(“OnEntityCreated”, “LogEntitySpawn”, function(ent)
dateAndTime = os.date("%b/%d/%Y") … " " … os.date("%H:%M:%S")
local stringFound = false

for _,v in pairs(SEARCH_STRING) do
	if (string.find(ent:GetClass(),v) != nil) then
		stringFound = true
	end
end
if (stringFound == true) then
        propLogger(ent:GetOwner(), ent:GetModel(), ent, dateAndTime)
end

end)
[/lua]