On hostA, in /etc/syslog.conf file,I am adding below line
*.err;kern.debug;daemon.notice;mail.crit @hostB
then I am restarting syslog service
svcadm restart /system/system-log
In hostA, I have already added hostB entry in /etc/hosts file & in hostB , I have also added hostA entry in /etc/hosts file. Both server are pinging as well.
Now when I am running below command on hostA, it is logging to local /var/adm/messages file but not in hostB /var/adm/messages file