ember.js Debugging Logging EmberData

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!


The ember data models have a toJSON method that extracts the relevant data:


This method uses the JSONSerializer to create the JSON representation.

If you want to log the data in a more app-specific way, you can use serialize:


which uses the serialization strategy you can define in the store's adapter to create a JSON representation of the model.

All objects in an Ember app, including Ember Data models, inherit from Ember.CoreObject, which has a toString method that prints this representation:



  • app-name is the name of your application
  • ember-type is the ember type of the object you are logging (can be controller, route etc.)
  • object-name is the name of the object you are logging (name of your model, or controller, or route etc.)
  • id is either a guId create with Ember.guidFor or, for example, the model's id.

You can overwrite this value using the method toStringExtension in your particular model.

For comparison example, here's how logging an application controller could look:


Got any ember.js Question?