rails-engine / audit-log Goto Github PK
View Code? Open in Web Editor NEW📑 Create audit logs into the database for user behaviors, including a web UI to query logs.
License: MIT License
📑 Create audit logs into the database for user behaviors, including a web UI to query logs.
License: MIT License
运行环境:
Mac pro 2015, IOS Monterey 12.4
ruby 3.0.2
rails 7.0.3
$ rails g audit_log:install /Users/danny/.rvm/gems/ruby-3.0.2/gems/railties-7.0.3/lib/rails/railtie/configuration.rb:96:in
method_missing': undefined method assets' for #<Rails::Application::Configuration:0x00007fe24aec9cd8 @root=#<Pathname:/Users/danny/ruby/sailing>, @generators=#<Rails::Configuration::Generators:0x00007fe24a94d0e8 @aliases={}, @options={:rails=>{:orm=>:active_record, :test_framework=>:test_unit, :integration_tool=>:test_unit, :system_tests=>:test_unit}, :active_record=>{:migration=>true, :timestamps=>true}, :test_unit=>{:fixture=>true, :fixture_replacement=>nil}}, @fallbacks={}, @templates=[], @colorize_logging=true, @api_only=true, @hidden_namespaces=[], @after_generate_callbacks=[]>, @middleware=#<Rails::Configuration::MiddlewareStackProxy:0x00007fe24aec9788 @operations=[#<Proc:0x00007fe24d5a7440 /Users/danny/.rvm/gems/ruby-3.0.2/gems/railties-7.0.3/lib/rails/configuration.rb:67 (lambda)>, #<Proc:0x00007fe24aefef28 /Users/danny/.rvm/gems/ruby-3.0.2/gems/railties-7.0.3/lib/rails/configuration.rb:67 (lambda)>, #<Proc:0x00007fe24d6026d8 /Users/danny/.rvm/gems/ruby-3.0.2/gems/railties-7.0.3/lib/rails/configuration.rb:53 (lambda)>, #<Proc:0x00007fe24db461a8 /Users/danny/.rvm/gems/ruby-3.0.2/gems/railties-7.0.3/lib/rails/configuration.rb:53 (lambda)>], @delete_operations=[]>, @javascript_path="javascript", @encoding=#<Encoding:UTF-8>, @allow_concurrency=nil, @consider_all_requests_local=true, @filter_parameters=[:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn], @filter_redirect=[], @helpers_paths=[], @hosts=[".localhost", #<IPAddr: IPv4:0.0.0.0/0.0.0.0>, #<IPAddr: IPv6:0000:0000:0000:0000:0000:0000:0000:0000/0000:0000:0000:0000:0000:0000:0000:0000>], @host_authorization={}, @public_file_server=#<ActiveSupport::OrderedOptions {:enabled=>true, :index_name=>"index"}>, @force_ssl=false, @ssl_options={:hsts=>{:subdomains=>true}}, @session_store=:cookie_store, @time_zone="Beijing", @beginning_of_week=:monday, @log_level=:debug, @cache_store=:null_store, @railties_order=[:all], @relative_url_root=nil, @reload_classes_only_on_change=true, @file_watcher=ActiveSupport::FileUpdateChecker, @exceptions_app=nil, @autoflush_log=true, @log_formatter=#<ActiveSupport::Logger::SimpleFormatter:0x00007fe249e28640 @datetime_format=nil>, @eager_load=false, @secret_key_base=nil, @api_only=true, @debug_exception_response_format=:api, @x=#<Rails::Application::Configuration::Custom:0x00007fe249e285a0 @configurations={}>, @enable_dependency_loading=false, @read_encrypted_secrets=false, @content_security_policy=nil, @content_security_policy_report_only=false, @content_security_policy_nonce_generator=nil, @content_security_policy_nonce_directives=nil, @require_master_key=false, @loaded_config_version=7.0, @credentials=#<ActiveSupport::OrderedOptions {:content_path=>#<Pathname:/Users/danny/ruby/sailing/config/credentials/development.yml.enc>, :key_path=>#<Pathname:/Users/danny/ruby/sailing/config/credentials/development.key>}>, @disable_sandbox=false, @add_autoload_paths_to_load_path=true, @permissions_policy=nil, @rake_eager_load=false, @server_timing=true, @paths=#<Rails::Paths::Root:0x00007fe24d59d8f0 @path=#<Pathname:/Users/danny/ruby/sailing>, @root={"app"=>#<Rails::Paths::Path:0x00007fe24d59d738 @paths=["app"], @current="app", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob="{*,*/concerns}", @exclude=["assets", "javascript"], @autoload_once=false, @eager_load=true, @autoload=false, @load_path=false>, "app/assets"=>#<Rails::Paths::Path:0x00007fe24d59d5d0 @paths=["app/assets"], @current="app/assets", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob="*", @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "app/controllers"=>#<Rails::Paths::Path:0x00007fe24d59d508 @paths=["app/controllers"], @current="app/controllers", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=true, @autoload=false, @load_path=false>, "app/channels"=>#<Rails::Paths::Path:0x00007fe24d59d468 @paths=["app/channels"], @current="app/channels", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=true, @autoload=false, @load_path=false>, "app/helpers"=>#<Rails::Paths::Path:0x00007fe24d59d3c8 @paths=["app/helpers"], @current="app/helpers", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=true, @autoload=false, @load_path=false>, "app/models"=>#<Rails::Paths::Path:0x00007fe24d59d328 @paths=["app/models"], @current="app/models", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=true, @autoload=false, @load_path=false>, "app/mailers"=>#<Rails::Paths::Path:0x00007fe24d59d288 @paths=["app/mailers"], @current="app/mailers", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=true, @autoload=false, @load_path=false>, "app/views"=>#<Rails::Paths::Path:0x00007fe24d59d1e8 @paths=["app/views"], @current="app/views", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "lib"=>#<Rails::Paths::Path:0x00007fe24d59d148 @paths=["lib"], @current="lib", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=true>, "lib/assets"=>#<Rails::Paths::Path:0x00007fe24d59d080 @paths=["lib/assets"], @current="lib/assets", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob="*", @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "lib/tasks"=>#<Rails::Paths::Path:0x00007fe24d59cfe0 @paths=["lib/tasks"], @current="lib/tasks", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob="**/*.rake", @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "config"=>#<Rails::Paths::Path:0x00007fe24d59cf68 @paths=["config"], @current="config", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "config/environments"=>#<Rails::Paths::Path:0x00007fe24d59ce50 @paths=["config/environments"], @current="config/environments", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob="development.rb", @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "config/initializers"=>#<Rails::Paths::Path:0x00007fe24d59cdb0 @paths=["config/initializers"], @current="config/initializers", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob="**/*.rb", @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "config/locales"=>#<Rails::Paths::Path:0x00007fe24d59cd10 @paths=["config/locales"], @current="config/locales", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob="**/*.{rb,yml}", @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "config/routes.rb"=>#<Rails::Paths::Path:0x00007fe24d59cc98 @paths=["config/routes.rb"], @current="config/routes.rb", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "config/routes"=>#<Rails::Paths::Path:0x00007fe24d59cbf8 @paths=["config/routes"], @current="config/routes", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob="**/*.rb", @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "db"=>#<Rails::Paths::Path:0x00007fe24d59cb80 @paths=["db"], @current="db", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "db/migrate"=>#<Rails::Paths::Path:0x00007fe24d59cb08 @paths=["db/migrate"], @current="db/migrate", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "db/seeds.rb"=>#<Rails::Paths::Path:0x00007fe24d59ca90 @paths=["db/seeds.rb"], @current="db/seeds.rb", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "vendor"=>#<Rails::Paths::Path:0x00007fe24d59c9f0 @paths=["vendor"], @current="vendor", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=true>, "vendor/assets"=>#<Rails::Paths::Path:0x00007fe24d59c950 @paths=["vendor/assets"], @current="vendor/assets", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob="*", @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "config/database"=>#<Rails::Paths::Path:0x00007fe24d59c8b0 @paths=["config/database.yml"], @current="config/database", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "config/secrets"=>#<Rails::Paths::Path:0x00007fe24d59c810 @paths=["config"], @current="config/secrets", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob="secrets.yml{,.enc}", @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "config/environment"=>#<Rails::Paths::Path:0x00007fe24d59c770 @paths=["config/environment.rb"], @current="config/environment", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "lib/templates"=>#<Rails::Paths::Path:0x00007fe24d59c6f8 @paths=["lib/templates"], @current="lib/templates", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "log"=>#<Rails::Paths::Path:0x00007fe24d59c608 @paths=["log/development.log"], @current="log", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "public"=>#<Rails::Paths::Path:0x00007fe24d59c590 @paths=["public"], @current="public", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "public/javascripts"=>#<Rails::Paths::Path:0x00007fe24d59c518 @paths=["public/javascripts"], @current="public/javascripts", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "public/stylesheets"=>#<Rails::Paths::Path:0x00007fe24d59c4a0 @paths=["public/stylesheets"], @current="public/stylesheets", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "tmp"=>#<Rails::Paths::Path:0x00007fe24d59c428 @paths=["tmp"], @current="tmp", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>, "config/cable"=>#<Rails::Paths::Path:0x00007fe24ac12080 @paths=["config/cable.yml"], @current="config/cable", @root=#<Rails::Paths::Root:0x00007fe24d59d8f0 ...>, @glob=nil, @exclude=nil, @autoload_once=false, @eager_load=false, @autoload=false, @load_path=false>}>, @autoload_paths=["/Users/danny/ruby/sailing/lib/**/"], @session_options={:key=>"sailing", :expire_after=>14 days, :httponly=>false}, @cache_classes=false, @eager_load_paths=["/Users/danny/ruby/sailing/app/channels", "/Users/danny/ruby/sailing/app/controllers", "/Users/danny/ruby/sailing/app/controllers/concerns", "/Users/danny/ruby/sailing/app/jobs", "/Users/danny/ruby/sailing/app/mailers", "/Users/danny/ruby/sailing/app/models", "/Users/danny/ruby/sailing/app/models/concerns"], @autoload_once_paths=[]> (NoMethodError) Did you mean? asset_host from /Users/danny/.rvm/gems/ruby-3.0.2/gems/audit-log-1.1.0/lib/audit-log/engine.rb:16:in
block in class:Engine'
from /Users/danny/.rvm/gems/ruby-3.0.2/gems/railties-7.0.3/lib/rails/initializable.rb:32:in instance_exec' from /Users/danny/.rvm/gems/ruby-3.0.2/gems/railties-7.0.3/lib/rails/initializable.rb:32:in
run'
from /Users/danny/.rvm/gems/ruby-3.0.2/gems/railties-7.0.3/lib/rails/initializable.rb:61:in block in run_initializers' from /Users/danny/.rvm/rubies/ruby-3.0.2/lib/ruby/3.0.0/tsort.rb:228:in
block in tsort_each'
from /Users/danny/.rvm/rubies/ruby-3.0.2/lib/ruby/3.0.0/tsort.rb:350:in block (2 levels) in each_strongly_connected_component' from /Users/danny/.rvm/rubies/ruby-3.0.2/lib/ruby/3.0.0/tsort.rb:431:in
each_strongly_connected_component_from'
from /Users/danny/.rvm/rubies/ruby-3.0.2/lib/ruby/3.0.0/tsort.rb:349:in block in each_strongly_connected_component' from /Users/danny/.rvm/rubies/ruby-3.0.2/lib/ruby/3.0.0/tsort.rb:347:in
each'
from /Users/danny/.rvm/rubies/ruby-3.0.2/lib/ruby/3.0.0/tsort.rb:347:in call' from /Users/danny/.rvm/rubies/ruby-3.0.2/lib/ruby/3.0.0/tsort.rb:347:in
each_strongly_connected_component'
from /Users/danny/.rvm/rubies/ruby-3.0.2/lib/ruby/3.0.0/tsort.rb:226:in tsort_each' from /Users/danny/.rvm/rubies/ruby-3.0.2/lib/ruby/3.0.0/tsort.rb:205:in
tsort_each'
from /Users/danny/.rvm/gems/ruby-3.0.2/gems/railties-7.0.3/lib/rails/initializable.rb:60:in run_initializers' from /Users/danny/.rvm/gems/ruby-3.0.2/gems/railties-7.0.3/lib/rails/application.rb:372:in
initialize!'
from /Users/danny/ruby/sailing/config/environment.rb:5:in <main>' from /Users/danny/.rvm/gems/ruby-3.0.2/gems/bootsnap-1.12.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in
require'
from /Users/danny/.rvm/gems/ruby-3.0.2/gems/bootsnap-1.12.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from /Users/danny/.rvm/gems/ruby-3.0.2/gems/zeitwerk-2.6.0/lib/zeitwerk/kernel.rb:35:in
require'
from /Users/danny/.rvm/gems/ruby-3.0.2/gems/railties-7.0.3/lib/rails/application.rb:348:in require_environment!' from /Users/danny/.rvm/gems/ruby-3.0.2/gems/railties-7.0.3/lib/rails/command/actions.rb:28:in
require_environment!'
from /Users/danny/.rvm/gems/ruby-3.0.2/gems/railties-7.0.3/lib/rails/command/actions.rb:15:in
require_application_and_environment!' from /Users/danny/.rvm/gems/ruby-3.0.2/gems/railties-7.0.3/lib/rails/commands/generate/generate_command.rb:21:in
perform'
from /Users/danny/.rvm/gems/ruby-3.0.2/gems/thor-1.2.1/lib/thor/command.rb:27:in run' from /Users/danny/.rvm/gems/ruby-3.0.2/gems/thor-1.2.1/lib/thor/invocation.rb:127:in
invoke_command'
from /Users/danny/.rvm/gems/ruby-3.0.2/gems/thor-1.2.1/lib/thor.rb:392:in dispatch' from /Users/danny/.rvm/gems/ruby-3.0.2/gems/railties-7.0.3/lib/rails/command/base.rb:87:in
perform'
from /Users/danny/.rvm/gems/ruby-3.0.2/gems/railties-7.0.3/lib/rails/command.rb:48:in invoke' from /Users/danny/.rvm/gems/ruby-3.0.2/gems/railties-7.0.3/lib/rails/commands.rb:18:in
require' from /Users/danny/.rvm/gems/ruby-3.0.2/gems/bootsnap-1.12.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in
require'<main>' ╭─danny@xuhaideMacBook-Pro-2 ~/ruby/sailing ‹ruby-3.0.2› ‹main*› ╰─$ 1 ↵
My project puts the logs in another database, hoping to be able to customize the model.
Is there a way we can only show the audit logs for records that have say a parent_id= X for example.
Can you add it so we can override the views so we can generate views into views folder same as devise does so we can style them
Hi,
I would like to submit a PR if thats ok for the following
If thats ok please let me know how to go about submitting for review
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.